Browse Source

replace indicator detail with ncutility startActivityIndicator

Marino Faggiana 6 years ago
parent
commit
c113654249

+ 0 - 2
iOSClient/Main/CCDetail.h

@@ -58,8 +58,6 @@
 @property (nonatomic, strong) NSString *passwordPDF;
 
 @property(nonatomic, weak) IBOutlet UIImageView *imageBackground;
-@property(nonatomic, weak) IBOutlet UIActivityIndicatorView *indicator;
-
 
 - (void)changeToDisplayMode;
 - (void)downloadPhotoBrowserSuccessFailure:(tableMetadata *)metadata selector:(NSString *)selector errorCode:(NSInteger)errorCode;

+ 3 - 4
iOSClient/Main/CCDetail.m

@@ -209,9 +209,8 @@
         // RichDocument
         if ([[NCViewerRichdocument sharedInstance] isRichDocument:self.metadataDetail]) {
             
-            self.indicator.color = [[NCBrandColor sharedInstance] brand];
-            [self.indicator startAnimating];
-
+            [[NCUtility sharedInstance] startActivityIndicatorWithView:self.view];
+            
             if ([self.metadataDetail.url isEqualToString:@""]) {
                 OCnetworking *ocNetworking = [[OCnetworking alloc] initWithDelegate:nil metadataNet:nil withUser:appDelegate.activeUser withUserID:appDelegate.activeUserID withPassword:appDelegate.activePassword withUrl:appDelegate.activeUrl];
                 
@@ -221,7 +220,7 @@
                     
                 } failure:^(NSString *message, NSInteger errorCode) {
                     
-                    [self.indicator stopAnimating];
+                    [[NCUtility sharedInstance] stopActivityIndicator];
                     [appDelegate messageNotification:@"_error_" description:message visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:errorCode];
                     [self.navigationController popViewControllerAnimated:YES];
                 }];

+ 0 - 5
iOSClient/Main/Create cloud/NCCreateFormUploadRichdocuments.swift

@@ -272,11 +272,6 @@ class NCCreateFormUploadRichdocuments: XLFormViewController, NCSelectDelegate, U
         }, failure: { (message, errorCode) in
             self.appDelegate.messageNotification("_error_", description: message, visible: true, delay: TimeInterval(k_dismissAfterSecond), type: TWMessageBarMessageType.error, errorCode: errorCode)
         })
-        
-        //self.dismiss(animated: true, completion: {
-            
-            //self.appDelegate.activeMain.uploadFileAsset(self.assets, serverUrl: self.serverUrl, useSubFolder: useSubFolder, session: self.session)
-        //})
     }
     
     @objc func cancel() {

+ 0 - 10
iOSClient/Main/Main.storyboard

@@ -285,27 +285,17 @@
                             <imageView userInteractionEnabled="NO" tag="999" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" preservesSuperviewLayoutMargins="YES" image="backgroundDetail" translatesAutoresizingMaskIntoConstraints="NO" id="zlU-MP-ZVs">
                                 <rect key="frame" x="134" y="296" width="107" height="75"/>
                             </imageView>
-                            <activityIndicatorView hidden="YES" opaque="NO" tag="998" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="tOl-wb-BCf">
-                                <rect key="frame" x="162.5" y="316" width="50" height="50"/>
-                                <constraints>
-                                    <constraint firstAttribute="width" constant="50" id="33J-1G-oRz" userLabel="width = 50"/>
-                                    <constraint firstAttribute="height" constant="50" id="jKr-0P-1Sh" userLabel="height = 50"/>
-                                </constraints>
-                            </activityIndicatorView>
                         </subviews>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
                             <constraint firstItem="zlU-MP-ZVs" firstAttribute="centerY" secondItem="cUA-lB-tGG" secondAttribute="centerY" id="NqJ-e6-LfV"/>
-                            <constraint firstItem="tOl-wb-BCf" firstAttribute="centerX" secondItem="3ph-Od-2hO" secondAttribute="centerX" id="Uxz-IU-DEW"/>
                             <constraint firstItem="zlU-MP-ZVs" firstAttribute="centerX" secondItem="3ph-Od-2hO" secondAttribute="centerX" id="VG7-UF-Zrf"/>
-                            <constraint firstItem="tOl-wb-BCf" firstAttribute="centerY" secondItem="3ph-Od-2hO" secondAttribute="centerY" id="ffA-CP-De8"/>
                         </constraints>
                         <viewLayoutGuide key="safeArea" id="3ph-Od-2hO"/>
                     </view>
                     <navigationItem key="navigationItem" id="cJm-UN-Dvj" userLabel="Detail"/>
                     <connections>
                         <outlet property="imageBackground" destination="zlU-MP-ZVs" id="XRF-iq-qSn"/>
-                        <outlet property="indicator" destination="tOl-wb-BCf" id="k7N-bT-bGi"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="IJ0-oL-QKv" userLabel="First Responder" sceneMemberID="firstResponder"/>

+ 1 - 2
iOSClient/Viewer/NCViewerRichdocument.swift

@@ -152,8 +152,7 @@ class NCViewerRichdocument: NSObject, WKNavigationDelegate, WKScriptMessageHandl
     }
     
     public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
-        detail.indicator.stopAnimating()
-        print("didFinish");
+        NCUtility.sharedInstance.stopActivityIndicator()
     }
      
     //MARK: -