Browse Source

Task Progress

Marino Faggiana 8 years ago
parent
commit
98736ef348
1 changed files with 13 additions and 0 deletions
  1. 13 0
      iOSClient/PhotosCameraUpload/CCPhotosCameraUpload.m

+ 13 - 0
iOSClient/PhotosCameraUpload/CCPhotosCameraUpload.m

@@ -61,6 +61,8 @@
         
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setupCameraUploadFull) name:@"setupCameraUploadFull" object:nil];
         
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(triggerProgressTask:) name:@"NotificationProgressTask" object:nil];
+        
         app.activePhotosCameraUpload = self;
     }
     
@@ -528,6 +530,17 @@
         [self.collectionView reloadItemsAtIndexPaths:@[indexPath]];
 }
 
+- (void)triggerProgressTask:(NSNotification *)notification
+{
+    NSDictionary *dict = notification.userInfo;
+    float progress = [[dict valueForKey:@"progress"] floatValue];
+    
+    if (progress == 0)
+        [self.navigationController cancelCCProgress];
+    else
+        [self.navigationController setCCProgressPercentage:progress*100 andTintColor:COLOR_NAVIGATIONBAR_PROGRESS];
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ==== Collection ====
 #pragma --------------------------------------------------------------------------------------------