Browse Source

change tab Photos to Media

Marino Faggiana 6 years ago
parent
commit
48d630612a
32 changed files with 71 additions and 1008 deletions
  1. 14 14
      Nextcloud.xcodeproj/project.pbxproj
  2. 2 2
      iOSClient/AppDelegate.h
  3. 15 15
      iOSClient/AppDelegate.m
  4. 1 1
      iOSClient/AutoUpload/NCAutoUpload.h
  5. 4 4
      iOSClient/AutoUpload/NCAutoUpload.m
  6. 1 1
      iOSClient/CCGlobal.h
  7. 5 5
      iOSClient/Create/CCCreateCloud.swift
  8. 0 0
      iOSClient/Images.xcassets/folderMedia.imageset/Contents.json
  9. 0 0
      iOSClient/Images.xcassets/folderMedia.imageset/folder.png
  10. 0 0
      iOSClient/Images.xcassets/folderMedia.imageset/folder@2x.png
  11. 0 0
      iOSClient/Images.xcassets/folderMedia.imageset/folder@3x.png
  12. 0 0
      iOSClient/Images.xcassets/media.imageset/Contents.json
  13. 0 0
      iOSClient/Images.xcassets/media.imageset/tabBarPhotos.png
  14. 0 0
      iOSClient/Images.xcassets/media.imageset/tabBarPhotos@2x.png
  15. 0 0
      iOSClient/Images.xcassets/media.imageset/tabBarPhotos@3x.png
  16. 0 0
      iOSClient/Images.xcassets/mediaNoRecord.imageset/Contents.json
  17. 0 0
      iOSClient/Images.xcassets/mediaNoRecord.imageset/photosNoRecord@2x.png
  18. 0 0
      iOSClient/Images.xcassets/quickActionMedia.imageset/Contents.json
  19. 0 0
      iOSClient/Images.xcassets/quickActionMedia.imageset/quickActionPhotos@2x.png
  20. 0 0
      iOSClient/Images.xcassets/quickActionMedia.imageset/quickActionPhotos@3x.png
  21. 10 10
      iOSClient/Main/CCMain.m
  22. 6 6
      iOSClient/Main/Main.storyboard
  23. 3 3
      iOSClient/Main/NCMainCommon.swift
  24. 1 1
      iOSClient/Move/CCMove.m
  25. 1 1
      iOSClient/Networking/CCNetworking.m
  26. 1 1
      iOSClient/Networking/NCService.swift
  27. 0 52
      iOSClient/Photos/CCPhotos.h
  28. 0 887
      iOSClient/Photos/CCPhotos.m
  29. 1 1
      iOSClient/Settings/CCManageAutoUpload.h
  30. 1 1
      iOSClient/Settings/CCManageAutoUpload.m
  31. 1 1
      iOSClient/Settings/CCSettings.m
  32. 4 2
      iOSClient/Supporting Files/en.lproj/Localizable.strings

+ 14 - 14
Nextcloud.xcodeproj/project.pbxproj

@@ -374,7 +374,6 @@
 		F77EB62A1EC0B50A003F814F /* CCCertificate.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F801011D98205A007537BC /* CCCertificate.m */; };
 		F78071091EDAB65800EAFFF6 /* NSNotificationCenter+MainThread.m in Sources */ = {isa = PBXBuildFile; fileRef = F78071081EDAB65800EAFFF6 /* NSNotificationCenter+MainThread.m */; };
 		F780710A1EDAB65800EAFFF6 /* NSNotificationCenter+MainThread.m in Sources */ = {isa = PBXBuildFile; fileRef = F78071081EDAB65800EAFFF6 /* NSNotificationCenter+MainThread.m */; };
-		F78071211EDB135100EAFFF6 /* CCPhotos.m in Sources */ = {isa = PBXBuildFile; fileRef = F78071201EDB135100EAFFF6 /* CCPhotos.m */; };
 		F78295311F962EFA00A572F5 /* NCEndToEndEncryption.m in Sources */ = {isa = PBXBuildFile; fileRef = F70CAE391F8CF31A008125FD /* NCEndToEndEncryption.m */; };
 		F784FA28210F672E00256C26 /* KTVCocoaHTTPServer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F784FA26210F672E00256C26 /* KTVCocoaHTTPServer.framework */; };
 		F784FA29210F672E00256C26 /* KTVHTTPCache.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F784FA27210F672E00256C26 /* KTVHTTPCache.framework */; };
@@ -520,6 +519,7 @@
 		F7DFE2581EBDC52E00CF5202 /* Realm.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F7DFE24F1EBDC3A400CF5202 /* Realm.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F7DFE25A1EBDC53200CF5202 /* RealmSwift.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F7DFE2501EBDC3A400CF5202 /* RealmSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F7E9C41B20F4CA870040CF18 /* CCTransfers.m in Sources */ = {isa = PBXBuildFile; fileRef = F7E9C41820F4CA870040CF18 /* CCTransfers.m */; };
+		F7EC9CBC21185F2000F1C5CE /* CCMedia.m in Sources */ = {isa = PBXBuildFile; fileRef = F7EC9CBB21185F2000F1C5CE /* CCMedia.m */; };
 		F7ECBA6D1E239DCD003E6328 /* CCCreateCloud.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7ECBA6C1E239DCD003E6328 /* CCCreateCloud.swift */; };
 		F7F54CE51E5B14C700E19C62 /* ImageError.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CAF1E5B14C700E19C62 /* ImageError.png */; };
 		F7F54CE61E5B14C700E19C62 /* ImageError@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CB01E5B14C700E19C62 /* ImageError@2x.png */; };
@@ -1260,8 +1260,6 @@
 		F77D49A71DC238E500CDC568 /* loading.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = loading.gif; sourceTree = "<group>"; };
 		F78071071EDAB65800EAFFF6 /* NSNotificationCenter+MainThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSNotificationCenter+MainThread.h"; sourceTree = "<group>"; };
 		F78071081EDAB65800EAFFF6 /* NSNotificationCenter+MainThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSNotificationCenter+MainThread.m"; sourceTree = "<group>"; };
-		F780711F1EDB135100EAFFF6 /* CCPhotos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhotos.h; sourceTree = "<group>"; };
-		F78071201EDB135100EAFFF6 /* CCPhotos.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCPhotos.m; sourceTree = "<group>"; };
 		F78316861C0CB3CA00C43975 /* CCShareUserOC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCShareUserOC.h; sourceTree = "<group>"; };
 		F78316871C0CB3CA00C43975 /* CCShareUserOC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCShareUserOC.m; sourceTree = "<group>"; };
 		F784FA25210F672E00256C26 /* KTVHTTPCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KTVHTTPCache.h; sourceTree = "<group>"; };
@@ -1605,6 +1603,8 @@
 		F7DFE2501EBDC3A400CF5202 /* RealmSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = RealmSwift.framework; sourceTree = "<group>"; };
 		F7E9C41520F4CA870040CF18 /* CCTransfers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTransfers.h; sourceTree = "<group>"; };
 		F7E9C41820F4CA870040CF18 /* CCTransfers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTransfers.m; sourceTree = "<group>"; };
+		F7EC9CBA21185F2000F1C5CE /* CCMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMedia.h; sourceTree = "<group>"; };
+		F7EC9CBB21185F2000F1C5CE /* CCMedia.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCMedia.m; sourceTree = "<group>"; };
 		F7ECBA6C1E239DCD003E6328 /* CCCreateCloud.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCCreateCloud.swift; sourceTree = "<group>"; };
 		F7F0617A1BAACDD300846525 /* CryptoCloud.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoCloud.pch; sourceTree = "<group>"; };
 		F7F54CAF1E5B14C700E19C62 /* ImageError.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ImageError.png; sourceTree = "<group>"; };
@@ -2537,15 +2537,6 @@
 			path = "File Provider Extension";
 			sourceTree = "<group>";
 		};
-		F780711E1EDB135100EAFFF6 /* Photos */ = {
-			isa = PBXGroup;
-			children = (
-				F780711F1EDB135100EAFFF6 /* CCPhotos.h */,
-				F78071201EDB135100EAFFF6 /* CCPhotos.m */,
-			);
-			path = Photos;
-			sourceTree = "<group>";
-		};
 		F784FA24210F672E00256C26 /* KTVHTTPCache */ = {
 			isa = PBXGroup;
 			children = (
@@ -3047,6 +3038,15 @@
 			path = Transfers;
 			sourceTree = "<group>";
 		};
+		F7EC9CB921185F2000F1C5CE /* Media */ = {
+			isa = PBXGroup;
+			children = (
+				F7EC9CBA21185F2000F1C5CE /* CCMedia.h */,
+				F7EC9CBB21185F2000F1C5CE /* CCMedia.m */,
+			);
+			path = Media;
+			sourceTree = "<group>";
+		};
 		F7ECBA6B1E239DCD003E6328 /* Create */ = {
 			isa = PBXGroup;
 			children = (
@@ -3170,10 +3170,10 @@
 				F7ECBA6B1E239DCD003E6328 /* Create */,
 				F7BAAD951ED5A63D00B7EAD4 /* Database */,
 				F7A3214D1E9E2A070069AD1B /* Favorites */,
-				F780711E1EDB135100EAFFF6 /* Photos */,
 				F7F54CAC1E5B143100E19C62 /* Library */,
 				F7BFFA621A24D7300044ED85 /* Login */,
 				F7BFCCBD1B68C21900548E76 /* ManageLocation+ManageAsset */,
+				F7EC9CB921185F2000F1C5CE /* Media */,
 				F7A321891E9E42B20069AD1B /* MenuAccount */,
 				F7F9E3451BC26B19004B9223 /* Move */,
 				F74D3DB81BAC1941000BAE4B /* Networking */,
@@ -3892,7 +3892,6 @@
 				F70022C51EC4C9100080073F /* OCNotificationsAction.m in Sources */,
 				F7D6650720FF341600BFBA9E /* NCMainCommon.swift in Sources */,
 				F77B0E231D118A16002130FE /* CCSharePermissionOC.m in Sources */,
-				F78071211EDB135100EAFFF6 /* CCPhotos.m in Sources */,
 				F762CAF81EACB66200B38484 /* XLFormButtonCell.m in Sources */,
 				F7CA1ED120E7E3FE002CC65E /* PKCircleProgressView.m in Sources */,
 				F75AE3C71E9D12900088BB09 /* SwiftyAvatar.swift in Sources */,
@@ -3913,6 +3912,7 @@
 				F7D4246B1F063B82009C9782 /* CTAssetsPageView.m in Sources */,
 				F73B4F0E1F470D9100BBEE4B /* nsMBCSGroupProber.cpp in Sources */,
 				F78964AE1EBB576C00403E13 /* JDStatusBarStyle.m in Sources */,
+				F7EC9CBC21185F2000F1C5CE /* CCMedia.m in Sources */,
 				F7D423831F0596C6009C9782 /* ReaderThumbFetch.m in Sources */,
 				F73B4F171F470D9100BBEE4B /* uchardet.cpp in Sources */,
 				F7D424721F063B82009C9782 /* CTAssetThumbnailOverlay.m in Sources */,

+ 2 - 2
iOSClient/AppDelegate.h

@@ -34,7 +34,7 @@
 #import "CCDetail.h"
 #import "CCQuickActions.h"
 #import "CCMain.h"
-#import "CCPhotos.h"
+#import "CCMedia.h"
 #import "CCSettings.h"
 #import "CCFavorites.h"
 #import "CCTransfers.h"
@@ -113,7 +113,7 @@
 @property (nonatomic, strong) CCMain *activeMain;
 @property (nonatomic, strong) CCMain *homeMain;
 @property (nonatomic, strong) CCFavorites *activeFavorites;
-@property (nonatomic, strong) CCPhotos *activePhotos;
+@property (nonatomic, strong) CCMedia *activeMedia;
 @property (nonatomic, retain) CCDetail *activeDetail;
 @property (nonatomic, retain) CCSettings *activeSettings;
 @property (nonatomic, retain) CCActivity *activeActivity;

+ 15 - 15
iOSClient/AppDelegate.m

@@ -27,7 +27,7 @@
 #import "AFURLSessionManager.h"
 #import "CCNetworking.h"
 #import "CCGraphics.h"
-#import "CCPhotos.h"
+#import "CCMedia.h"
 #import "CCSynchronize.h"
 #import "CCMain.h"
 #import "CCDetail.h"
@@ -520,15 +520,15 @@
 {
     NSString *bundleId = [NSBundle mainBundle].bundleIdentifier;
 
-    UIApplicationShortcutIcon *shortcutPhotosIcon = [UIApplicationShortcutIcon iconWithTemplateImageName:@"quickActionPhotos"];
+    UIApplicationShortcutIcon *shortcutMediaIcon = [UIApplicationShortcutIcon iconWithTemplateImageName:@"quickActionMedia"];
     UIApplicationShortcutIcon *shortcutUploadIcon = [UIApplicationShortcutIcon iconWithTemplateImageName:@"quickActionUpload"];
     
-    UIApplicationShortcutItem *shortcutPhotos = [[UIApplicationShortcutItem alloc] initWithType:[NSString stringWithFormat:@"%@.photos", bundleId] localizedTitle:NSLocalizedString(@"_photo_camera_", nil) localizedSubtitle:nil icon:shortcutPhotosIcon userInfo:nil];
+    UIApplicationShortcutItem *shortcutMedia = [[UIApplicationShortcutItem alloc] initWithType:[NSString stringWithFormat:@"%@.media", bundleId] localizedTitle:NSLocalizedString(@"_media_", nil) localizedSubtitle:nil icon:shortcutMediaIcon userInfo:nil];
     UIApplicationShortcutItem *shortcutUpload = [[UIApplicationShortcutItem alloc] initWithType:[NSString stringWithFormat:@"%@.upload", bundleId] localizedTitle:NSLocalizedString(@"_upload_file_", nil) localizedSubtitle:nil icon:shortcutUploadIcon userInfo:nil];
    
     // add the array to our app
-    if (shortcutUpload && shortcutPhotos)
-        [UIApplication sharedApplication].shortcutItems = @[shortcutUpload, shortcutPhotos];
+    if (shortcutUpload && shortcutMedia)
+        [UIApplication sharedApplication].shortcutItems = @[shortcutUpload, shortcutMedia];
 }
 
 - (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler
@@ -544,7 +544,7 @@
     
     NSString *bundleId = [NSBundle mainBundle].bundleIdentifier;
     
-    NSString *shortcutPhotos = [NSString stringWithFormat:@"%@.photos", bundleId];
+    NSString *shortcutMedia = [NSString stringWithFormat:@"%@.media", bundleId];
     NSString *shortcutUpload = [NSString stringWithFormat:@"%@.upload", bundleId];
     NSString *shortcutUploadEncrypted = [NSString stringWithFormat:@"%@.uploadEncrypted", bundleId];
         
@@ -626,7 +626,7 @@
         handled = YES;
     }
     
-    else if ([shortcutItem.type isEqualToString:shortcutPhotos] && self.activeAccount) {
+    else if ([shortcutItem.type isEqualToString:shortcutMedia] && self.activeAccount) {
         
         dispatch_async(dispatch_get_main_queue(), ^{
 
@@ -641,7 +641,7 @@
                         [nvc popToRootViewControllerAnimated:NO];
                 }
             
-                [tbc setSelectedIndex: k_tabBarApplicationIndexPhotos];
+                [tbc setSelectedIndex: k_tabBarApplicationIndexMedia];
 
             } else {
             
@@ -649,7 +649,7 @@
                 [nvcDetail popToRootViewControllerAnimated:NO];
             
                 UITabBarController *tbc = splitViewController.viewControllers.firstObject;
-                [tbc setSelectedIndex: k_tabBarApplicationIndexPhotos];
+                [tbc setSelectedIndex: k_tabBarApplicationIndexMedia];
             }
         });
         
@@ -824,11 +824,11 @@
     item.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"tabBarPlus"] multiplier:3 color:[UIColor clearColor]];
     item.enabled = false;
     
-    // Photos
-    item = [tabBarController.tabBar.items objectAtIndex: k_tabBarApplicationIndexPhotos];
-    [item setTitle:NSLocalizedString(@"_photo_camera_", nil)];
-    item.image = [UIImage imageNamed:@"photos"];
-    item.selectedImage = [UIImage imageNamed:@"photos"];
+    // Media
+    item = [tabBarController.tabBar.items objectAtIndex: k_tabBarApplicationIndexMedia];
+    [item setTitle:NSLocalizedString(@"_media_", nil)];
+    item.image = [UIImage imageNamed:@"media"];
+    item.selectedImage = [UIImage imageNamed:@"media"];
     
     // More
     item = [tabBarController.tabBar.items objectAtIndex: k_tabBarApplicationIndexMore];
@@ -971,7 +971,7 @@
     } else if (index == k_tabBarApplicationIndexFavorite) {
         if (self.activeFavorites.serverUrl)
             serverUrl = self.activeFavorites.serverUrl;
-    } else if (index == k_tabBarApplicationIndexPhotos) {
+    } else if (index == k_tabBarApplicationIndexMedia) {
         serverUrl = [[NCManageDatabase sharedInstance] getAccountAutoUploadPath:self.activeUrl];
     }
     

+ 1 - 1
iOSClient/AutoUpload/NCAutoUpload.h

@@ -35,7 +35,7 @@
 - (BOOL)checkIfLocationIsEnabled;
 - (void)setupAutoUploadFull;
 
-- (BOOL)createAutoUploadFolderPhotosWithSubFolder:(BOOL)useSubFolder assets:(PHFetchResult *)assets selector:(NSString *)selector;
+- (BOOL)createAutoUploadFolderWithSubFolder:(BOOL)useSubFolder assets:(PHFetchResult *)assets selector:(NSString *)selector;
 
 - (void)alignPhotoLibrary;
 

+ 4 - 4
iOSClient/AutoUpload/NCAutoUpload.m

@@ -364,8 +364,8 @@
         }
     });
     
-    // Create the folder for Photos & if request the subfolders
-    if(![[NCAutoUpload sharedInstance] createAutoUploadFolderPhotosWithSubFolder:tableAccount.autoUploadCreateSubfolder assets:newAssetToUpload selector:selector]) {
+    // Create the folder for auto upload & if request the subfolders
+    if(![[NCAutoUpload sharedInstance] createAutoUploadFolderWithSubFolder:tableAccount.autoUploadCreateSubfolder assets:newAssetToUpload selector:selector]) {
         dispatch_async(dispatch_get_main_queue(), ^{
             // end loading
             [_hud hideHud];
@@ -477,10 +477,10 @@
 }
 
 #pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Create Folder SubFolder Auto Upload Folder Photos ====
+#pragma mark ===== Create Folder SubFolder Auto Upload Folder Photos/Videos ====
 #pragma --------------------------------------------------------------------------------------------
 
-- (BOOL)createAutoUploadFolderPhotosWithSubFolder:(BOOL)useSubFolder assets:(PHFetchResult *)assets selector:(NSString *)selector
+- (BOOL)createAutoUploadFolderWithSubFolder:(BOOL)useSubFolder assets:(PHFetchResult *)assets selector:(NSString *)selector
 {
     NSString *fileID;
     NSError *error;

+ 1 - 1
iOSClient/CCGlobal.h

@@ -255,7 +255,7 @@
 #define k_tabBarApplicationIndexFile                    0
 #define k_tabBarApplicationIndexFavorite                1
 #define k_tabBarApplicationIndexPlusHide                2
-#define k_tabBarApplicationIndexPhotos                  3
+#define k_tabBarApplicationIndexMedia                   3
 #define k_tabBarApplicationIndexMore                    4
 
 // Filename Mask and Type

+ 5 - 5
iOSClient/Create/CCCreateCloud.swift

@@ -65,7 +65,7 @@ class CreateMenuAdd: NSObject {
         
         actionSheet.cancelButtonTitle = NSLocalizedString("_cancel_", comment: "")
         
-        actionSheet.addButton(withTitle: NSLocalizedString("_upload_photos_videos_", comment: ""), image: CCGraphics.changeThemingColorImage(UIImage(named: "photos"), multiplier:2, color: colorGray), backgroundColor: NCBrandColor.sharedInstance.backgroundView, height: 50.0, type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
+        actionSheet.addButton(withTitle: NSLocalizedString("_upload_photos_videos_", comment: ""), image: CCGraphics.changeThemingColorImage(UIImage(named: "media"), multiplier:2, color: colorGray), backgroundColor: NCBrandColor.sharedInstance.backgroundView, height: 50.0, type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
             appDelegate.activeMain.returnCreate(Int(k_returnCreateFotoVideoPlain))
         })
         
@@ -154,14 +154,14 @@ class CreateFormUploadAssets: XLFormViewController, CCMoveDelegate {
         
         // Folder Photo
         
-        row = XLFormRowDescriptor(tag: "useFolderPhoto", rowType: XLFormRowDescriptorTypeBooleanSwitch, title: NSLocalizedString("_use_folder_photos_", comment: ""))
+        row = XLFormRowDescriptor(tag: "useFolderMedia", rowType: XLFormRowDescriptorTypeBooleanSwitch, title: NSLocalizedString("_use_folder_media_", comment: ""))
         row.value = 0
         row.cellConfig.setObject(UIFont.systemFont(ofSize: 15.0), forKey: "textLabel.font" as NSCopying)
         section.addFormRow(row)
         
         // Use Sub folder
         row = XLFormRowDescriptor(tag: "useSubFolder", rowType: XLFormRowDescriptorTypeBooleanSwitch, title: NSLocalizedString("_autoupload_create_subfolder_", comment: ""))
-        row.hidden = "$\("useFolderPhoto") == 0"
+        row.hidden = "$\("useFolderMedia") == 0"
         row.cellConfig.setObject(UIFont.systemFont(ofSize: 15.0), forKey: "textLabel.font" as NSCopying)
         
         let tableAccount = NCManageDatabase.sharedInstance.getAccountActive()
@@ -222,7 +222,7 @@ class CreateFormUploadAssets: XLFormViewController, CCMoveDelegate {
         
         super.formRowDescriptorValueHasChanged(formRow, oldValue: oldValue, newValue: newValue)
         
-        if formRow.tag == "useFolderPhoto" {
+        if formRow.tag == "useFolderMedia" {
             
             if (formRow.value! as AnyObject).boolValue  == true {
                 
@@ -349,7 +349,7 @@ class CreateFormUploadAssets: XLFormViewController, CCMoveDelegate {
         
         self.dismiss(animated: true, completion: {
             
-            let useFolderPhotoRow : XLFormRowDescriptor  = self.form.formRow(withTag: "useFolderPhoto")!
+            let useFolderPhotoRow : XLFormRowDescriptor  = self.form.formRow(withTag: "useFolderMedia")!
             let useSubFolderRow : XLFormRowDescriptor  = self.form.formRow(withTag: "useSubFolder")!
             var useSubFolder : Bool = false
             

+ 0 - 0
iOSClient/Images.xcassets/folderPhotos.imageset/Contents.json → iOSClient/Images.xcassets/folderMedia.imageset/Contents.json


+ 0 - 0
iOSClient/Images.xcassets/folderPhotos.imageset/folder.png → iOSClient/Images.xcassets/folderMedia.imageset/folder.png


+ 0 - 0
iOSClient/Images.xcassets/folderPhotos.imageset/folder@2x.png → iOSClient/Images.xcassets/folderMedia.imageset/folder@2x.png


+ 0 - 0
iOSClient/Images.xcassets/folderPhotos.imageset/folder@3x.png → iOSClient/Images.xcassets/folderMedia.imageset/folder@3x.png


+ 0 - 0
iOSClient/Images.xcassets/photos.imageset/Contents.json → iOSClient/Images.xcassets/media.imageset/Contents.json


+ 0 - 0
iOSClient/Images.xcassets/photos.imageset/tabBarPhotos.png → iOSClient/Images.xcassets/media.imageset/tabBarPhotos.png


+ 0 - 0
iOSClient/Images.xcassets/photos.imageset/tabBarPhotos@2x.png → iOSClient/Images.xcassets/media.imageset/tabBarPhotos@2x.png


+ 0 - 0
iOSClient/Images.xcassets/photos.imageset/tabBarPhotos@3x.png → iOSClient/Images.xcassets/media.imageset/tabBarPhotos@3x.png


+ 0 - 0
iOSClient/Images.xcassets/photosNoRecord.imageset/Contents.json → iOSClient/Images.xcassets/mediaNoRecord.imageset/Contents.json


+ 0 - 0
iOSClient/Images.xcassets/photosNoRecord.imageset/photosNoRecord@2x.png → iOSClient/Images.xcassets/mediaNoRecord.imageset/photosNoRecord@2x.png


+ 0 - 0
iOSClient/Images.xcassets/quickActionPhotos.imageset/Contents.json → iOSClient/Images.xcassets/quickActionMedia.imageset/Contents.json


+ 0 - 0
iOSClient/Images.xcassets/quickActionPhotos.imageset/quickActionPhotos@2x.png → iOSClient/Images.xcassets/quickActionMedia.imageset/quickActionPhotos@2x.png


+ 0 - 0
iOSClient/Images.xcassets/quickActionPhotos.imageset/quickActionPhotos@3x.png → iOSClient/Images.xcassets/quickActionMedia.imageset/quickActionPhotos@3x.png


+ 10 - 10
iOSClient/Main/CCMain.m

@@ -23,7 +23,7 @@
 
 #import "CCMain.h"
 #import "AppDelegate.h"
-#import "CCPhotos.h"
+#import "CCMedia.h"
 #import "CCSynchronize.h"
 #import "OCActivity.h"
 #import "OCNotifications.h"
@@ -1202,9 +1202,9 @@
             if (appDelegate.activeDetail)
                 [appDelegate.activeDetail downloadPhotoBrowserSuccessFailure:metadata selector:selector errorCode:0];
             
-            // Photos
-            if (appDelegate.activePhotos)
-                [appDelegate.activePhotos downloadFileSuccessFailure:metadata.fileName fileID:metadata.fileID serverUrl:serverUrl selector:selector errorMessage:errorMessage errorCode:errorCode];
+            // Media
+            if (appDelegate.activeMedia)
+                [appDelegate.activeMedia downloadFileSuccessFailure:metadata.fileName fileID:metadata.fileID serverUrl:serverUrl selector:selector errorMessage:errorMessage errorCode:errorCode];
             
             [[NCMainCommon sharedInstance] reloadDatasourceWithServerUrl:serverUrl];
         }
@@ -1232,9 +1232,9 @@
                 if (appDelegate.activeDetail)
                     [appDelegate.activeDetail downloadPhotoBrowserSuccessFailure:metadata selector:selector errorCode:errorCode];
                 
-                // Updating Photos
-                if (appDelegate.activePhotos)
-                    [appDelegate.activePhotos downloadFileSuccessFailure:metadata.fileName fileID:metadata.fileID serverUrl:serverUrl selector:selector errorMessage:errorMessage errorCode:errorCode];
+                // Updating Media
+                if (appDelegate.activeMedia)
+                    [appDelegate.activeMedia downloadFileSuccessFailure:metadata.fileName fileID:metadata.fileID serverUrl:serverUrl selector:selector errorMessage:errorMessage errorCode:errorCode];
             });
             
         }
@@ -1318,9 +1318,9 @@
  
         NSString *autoUploadPath = [[NCManageDatabase sharedInstance] getAccountAutoUploadPath:appDelegate.activeUrl];
 
-        // if request create the folder for Photos & the subfolders
+        // if request create the folder for Auto Upload & the subfolders
         if ([autoUploadPath isEqualToString:serverUrl])
-            if (![[NCAutoUpload sharedInstance] createAutoUploadFolderPhotosWithSubFolder:useSubFolder assets:(PHFetchResult *)assets selector:selectorUploadFile])
+            if (![[NCAutoUpload sharedInstance] createAutoUploadFolderWithSubFolder:useSubFolder assets:(PHFetchResult *)assets selector:selectorUploadFile])
                 return;
     
         dispatch_async(dispatch_get_main_queue(), ^{
@@ -3661,7 +3661,7 @@
         if (!([_metadata.fileName isEqualToString:_autoUploadFileName] == YES && [serverUrl isEqualToString:_autoUploadDirectory] == YES)) {
             
             [actionSheet addButtonWithTitle:NSLocalizedString(@"_folder_automatic_upload_", nil)
-                                      image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folderPhotos"] multiplier:2 color:[NCBrandColor sharedInstance].icon]
+                                      image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folderMedia"] multiplier:2 color:[NCBrandColor sharedInstance].icon]
                             backgroundColor:[NCBrandColor sharedInstance].backgroundView
                                      height:50.0
                                        type:AHKActionSheetButtonTypeDefault

+ 6 - 6
iOSClient/Main/Main.storyboard

@@ -218,10 +218,10 @@
             </objects>
             <point key="canvasLocation" x="9212" y="1216.9950738916257"/>
         </scene>
-        <!--Photos-->
+        <!--Media-->
         <scene sceneID="kWr-RF-gdq">
             <objects>
-                <collectionViewController id="1Ca-6H-d29" customClass="CCPhotos" sceneMemberID="viewController">
+                <collectionViewController id="1Ca-6H-d29" customClass="CCMedia" sceneMemberID="viewController">
                     <collectionView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" id="zkC-IW-U7O">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -555,11 +555,11 @@
             </objects>
             <point key="canvasLocation" x="5857" y="1218"/>
         </scene>
-        <!--Photos-->
+        <!--Media-->
         <scene sceneID="IuY-Iu-oAm">
             <objects>
-                <navigationController extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="Npr-vu-PSD" sceneMemberID="viewController">
-                    <tabBarItem key="tabBarItem" title="Photos" image="photos" id="5cw-bP-7It"/>
+                <navigationController extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="Npr-vu-PSD" userLabel="Media" sceneMemberID="viewController">
+                    <tabBarItem key="tabBarItem" title="Media" image="media" id="5cw-bP-7It"/>
                     <toolbarItems/>
                     <navigationBar key="navigationBar" contentMode="scaleToFill" id="ixg-Pw-TNO">
                         <rect key="frame" x="0.0" y="44" width="375" height="44"/>
@@ -806,7 +806,7 @@
         <image name="disclosureIndicator" width="13" height="14"/>
         <image name="favorite" width="25" height="25"/>
         <image name="folder" width="25" height="25"/>
-        <image name="photos" width="25" height="25"/>
+        <image name="media" width="25" height="25"/>
         <image name="tabBarMore" width="25" height="25"/>
         <image name="tabBarPlus" width="40" height="40"/>
     </resources>

+ 3 - 3
iOSClient/Main/NCMainCommon.swift

@@ -227,8 +227,8 @@ class NCMainCommon: NSObject {
                     cell.file.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "folderEncrypted"), multiplier: 3, color: NCBrandColor.sharedInstance.brandElement)
                     cell.imageTitleSegue = UIImage.init(named: "lock")
                 } else if metadata.fileName == autoUploadFileName && serverUrl == autoUploadDirectory {
-                    cell.file.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "folderPhotos"), multiplier: 3, color: NCBrandColor.sharedInstance.brandElement)
-                    cell.imageTitleSegue = UIImage.init(named: "photos")
+                    cell.file.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "folderMedia"), multiplier: 3, color: NCBrandColor.sharedInstance.brandElement)
+                    cell.imageTitleSegue = UIImage.init(named: "media")
                 } else if isShare {
                     cell.file.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "folder_shared_with_me"), multiplier: 3, color: NCBrandColor.sharedInstance.brandElement)
                     cell.imageTitleSegue = UIImage.init(named: "share")
@@ -587,7 +587,7 @@ class NCMainCommon: NSObject {
         
         // reload for filesID
         self.appDelegate.activeMain.reloadDatasource()
-        self.appDelegate.activePhotos.reloadDatasource()
+        self.appDelegate.activeMedia.reloadDatasource()
     }
 }
     

+ 1 - 1
iOSClient/Move/CCMove.m

@@ -407,7 +407,7 @@
     if (metadata.e2eEncrypted)
         cell.imageView.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folderEncrypted"] multiplier:2 color:[NCBrandColor sharedInstance].brandElement];
     else if ([metadata.fileName isEqualToString:_autoUploadFileName] && [self.serverUrl isEqualToString:_autoUploadDirectory])
-        cell.imageView.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folderPhotos"] multiplier:2 color:[NCBrandColor sharedInstance].brandElement];
+        cell.imageView.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folderMedia"] multiplier:2 color:[NCBrandColor sharedInstance].brandElement];
     else
         cell.imageView.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folder"] multiplier:2 color:[NCBrandColor sharedInstance].brandElement];
     

+ 1 - 1
iOSClient/Networking/CCNetworking.m

@@ -1133,7 +1133,7 @@
         [appDelegate.listProgressMetadata removeObjectForKey:metadata.fileID];
         // Hardcoded for add new Photos
         if ([metadata.typeFile isEqualToString:k_metadataTypeFile_image] || [metadata.typeFile isEqualToString:k_metadataTypeFile_video]) {
-            [appDelegate.activePhotos.addMetadatasFromUpload addObject:metadata];
+            [appDelegate.activeMedia.addMetadatasFromUpload addObject:metadata];
         }
 #endif
         

+ 1 - 1
iOSClient/Networking/NCService.swift

@@ -243,7 +243,7 @@ class NCService: NSObject, OCNetworkingDelegate {
             
             // Call func thath required the userdID
             appDelegate.activeFavorites.listingFavorites()
-            appDelegate.activePhotos.searchPhotoVideo()
+            appDelegate.activeMedia.searchPhotoVideo()
             
             DispatchQueue.global(qos: .default).async {
                 

+ 0 - 52
iOSClient/Photos/CCPhotos.h

@@ -1,52 +0,0 @@
-//
-//  CCPhotos.h
-//  Nextcloud iOS
-//
-//  Created by Marino Faggiana on 29/07/15.
-//  Copyright (c) 2017 TWS. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <UIKit/UIKit.h>
-#import <Photos/Photos.h>
-#import <ImageIO/ImageIO.h>
-
-#import "UIScrollView+EmptyDataSet.h"
-#import "OCErrorMsg.h"
-#import "TWMessageBarManager.h"
-#import "CCManageLocation.h"
-#import "CCDetail.h"
-#import "CCUtility.h"
-#import "CCSection.h"
-#import "CCHud.h"
-#import "OCNetworking.h"
-#import "CCMove.h"
-
-@class tableMetadata;
-
-@interface CCPhotos: UICollectionViewController <UICollectionViewDataSource, UICollectionViewDelegate, UIActionSheetDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate, OCNetworkingDelegate, CCMoveDelegate>
-
-@property (nonatomic, weak) CCDetail *detailViewController;
-@property (nonatomic, strong) tableMetadata *metadata;
-@property (nonatomic, strong) NSMutableArray *addMetadatasFromUpload;
-
-- (void)downloadFileSuccessFailure:(NSString *)fileName fileID:(NSString *)fileID serverUrl:(NSString *)serverUrl selector:(NSString *)selector errorMessage:(NSString *)errorMessage errorCode:(NSInteger)errorCode;
-
-- (void)reloadDatasource;
-- (void)searchPhotoVideo;
-
-@end

+ 0 - 887
iOSClient/Photos/CCPhotos.m

@@ -1,887 +0,0 @@
-//
-//  CCPhotos.m
-//  Nextcloud iOS
-//
-//  Created by Marino Faggiana on 29/07/15.
-//  Copyright (c) 2017 TWS. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CCPhotos.h"
-#import "AppDelegate.h"
-#import "CCManageAutoUpload.h"
-#import "TOScrollBar.h"
-#import "NCBridgeSwift.h"
-
-@interface CCPhotos ()
-{
-    AppDelegate *appDelegate;
-
-    NSMutableArray *selectedMetadatas;
-    CCSectionDataSourceMetadata *sectionDataSource;
-    NSString *saveDirectoryID, *saveServerUrl;
-    
-    BOOL filterTypeFileImage;
-    BOOL filterTypeFileVideo;
-    
-    BOOL isSearchMode;
-    BOOL isEditMode;
-    
-    TOScrollBar *scrollBar;
-    NSMutableDictionary *saveEtagForStartDirectory;
-    
-    // Fix Crash Thumbnail + collectionView ReloadData ?
-    NSInteger counterThumbnail;
-    BOOL collectionViewReloadDataInProgress;
-}
-@end
-
-@implementation CCPhotos
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Init =====
-#pragma --------------------------------------------------------------------------------------------
-
--  (id)initWithCoder:(NSCoder *)aDecoder
-{
-    if (self = [super initWithCoder:aDecoder])  {
-        
-        appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(triggerProgressTask:) name:@"NotificationProgressTask" object:nil];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
-        
-        appDelegate.activePhotos = self;
-    }
-    
-    return self;
-}
-
-- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
-{
-    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
-    
-    if (self) {
-        
-        appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-    }
-    
-    return self;
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== View =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)viewDidLoad
-{
-    [super viewDidLoad];
-    
-    saveEtagForStartDirectory = [NSMutableDictionary new];
-    selectedMetadatas = [NSMutableArray new];
-    self.addMetadatasFromUpload = [NSMutableArray new];
-    
-    // empty Data Source
-    self.collectionView.emptyDataSetDelegate = self;
-    self.collectionView.emptyDataSetSource = self;
-
-    // scroll bar
-    scrollBar = [TOScrollBar new];
-    [self.collectionView to_addScrollBar:scrollBar];
-    
-    scrollBar.handleTintColor = [NCBrandColor sharedInstance].brand;
-    scrollBar.handleWidth = 20;
-    scrollBar.handleMinimiumHeight = 20;
-    scrollBar.trackWidth = 0;
-    scrollBar.edgeInset = 12;
-}
-
-// Apparirà
-- (void)viewWillAppear:(BOOL)animated
-{
-    [super viewWillAppear:animated];
-    
-    // Color
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar online:[appDelegate.reachability isReachable] hidden:NO];
-    [appDelegate aspectTabBar:self.tabBarController.tabBar hidden:NO];
-    
-    // Plus Button
-    [appDelegate plusButtonVisibile:true];
-
-    [self reloadDatasource];
-}
-
-- (void)viewSafeAreaInsetsDidChange
-{
-    [super viewSafeAreaInsetsDidChange];
-    
-    self.collectionView.contentInset = self.view.safeAreaInsets;
-}
-
-- (void)changeTheming
-{
-    if (self.isViewLoaded && self.view.window)
-        [appDelegate changeTheming:self];
-    
-    scrollBar.handleTintColor = [NCBrandColor sharedInstance].brand;
-    
-    [self.collectionView reloadData];
-}
-
-- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
-{
-    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
-    
-    // Before rotation
-    
-    [coordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
-        
-        if (self.view.frame.size.width == ([[UIScreen mainScreen] bounds].size.width*([[UIScreen mainScreen] bounds].size.width<[[UIScreen mainScreen] bounds].size.height))+([[UIScreen mainScreen] bounds].size.height*([[UIScreen mainScreen] bounds].size.width>[[UIScreen mainScreen] bounds].size.height))) {
-            
-            // Portrait
-            
-        } else {
-            
-            // Landscape
-        }
-        
-    }];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Gestione Grafica Window =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)setUINavigationBarDefault
-{
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar online:[appDelegate.reachability isReachable] hidden:NO];
- 
-    // curront folder search
-    NSString *directory = [[NCManageDatabase sharedInstance] getAccountStartDirectoryPhotosTab:[CCUtility getHomeServerUrlActiveUrl:appDelegate.activeUrl]];
-    NSString *home = [CCUtility getHomeServerUrlActiveUrl:appDelegate.activeUrl];
-    NSString *folder = @"";
-    if (home.length > 0) {
-        folder = [directory stringByReplacingOccurrencesOfString:home withString:@""];
-    }
-    
-    // Title
-    self.navigationItem.titleView = nil;
-    if (folder.length == 0) {
-        self.navigationItem.title = NSLocalizedString(@"_photo_camera_", nil);
-    } else {
-        self.navigationItem.title = [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"_photo_camera_", nil), [folder substringFromIndex:1]];
-    }
-    
-    if (isSearchMode) {
-        [CCGraphics addImageToTitle:self.navigationItem.title colorTitle:[NCBrandColor sharedInstance].brandText imageTitle:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"load"] multiplier:2 color:[NCBrandColor sharedInstance].brandText] imageRight:YES navigationItem:self.navigationItem];
-    }
-    
-    // Button Item RIGHT
-    UIBarButtonItem *buttonSelect = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"select"] style:UIBarButtonItemStylePlain target:self action:@selector(editingModeYES)];
-    
-    if ([sectionDataSource.allRecordsDataSource count] > 0) {
-        self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:buttonSelect, nil];
-    } else {
-        self.navigationItem.rightBarButtonItems = nil;
-    }
-    
-    // Button Item LEFT
-    UIBarButtonItem *buttonStartDirectoryPhotosTab = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"folderPhotos"] style:UIBarButtonItemStylePlain target:self action:@selector(selectStartDirectoryPhotosTab)];
-    UIBarButtonItem *buttonImageFilterYesPhotosTab = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"imageyes"] style:UIBarButtonItemStylePlain target:self action:@selector(buttonImageFilterYes)];
-    UIBarButtonItem *buttonImageFilterNoPhotosTab = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"imageno"] style:UIBarButtonItemStylePlain target:self action:@selector(buttonImageFilterNo)];
-    UIBarButtonItem *buttonVideoFilterYesPhotosTab = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"videoyes"] style:UIBarButtonItemStylePlain target:self action:@selector(buttonVideoFilterYes)];
-    UIBarButtonItem *buttonVideoFilterNoPhotosTab = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"videono"] style:UIBarButtonItemStylePlain target:self action:@selector(buttonVideoFilterNo)];
-
-    if (filterTypeFileImage && filterTypeFileVideo) {
-        self.navigationItem.leftBarButtonItems = [[NSArray alloc] initWithObjects:buttonStartDirectoryPhotosTab, buttonImageFilterNoPhotosTab, buttonVideoFilterNoPhotosTab,nil];
-    } else if (filterTypeFileImage && !filterTypeFileVideo) {
-        self.navigationItem.leftBarButtonItems = [[NSArray alloc] initWithObjects:buttonStartDirectoryPhotosTab, buttonImageFilterNoPhotosTab, buttonVideoFilterYesPhotosTab,nil];
-    } else if (!filterTypeFileImage && filterTypeFileVideo) {
-        self.navigationItem.leftBarButtonItems = [[NSArray alloc] initWithObjects:buttonStartDirectoryPhotosTab, buttonImageFilterYesPhotosTab, buttonVideoFilterNoPhotosTab,nil];
-    } else {
-        self.navigationItem.leftBarButtonItems = [[NSArray alloc] initWithObjects:buttonStartDirectoryPhotosTab, buttonImageFilterYesPhotosTab, buttonVideoFilterYesPhotosTab,nil];
-    }
-}
-
-- (void)setUINavigationBarSelected
-{
-    UIImage *icon;
-    
-    icon = [UIImage imageNamed:@"delete"];
-    UIBarButtonItem *buttonDelete = [[UIBarButtonItem alloc] initWithImage:icon style:UIBarButtonItemStylePlain target:self action:@selector(deleteSelectedFiles)];
-    
-    icon = [UIImage imageNamed:@"openFile"];
-    UIBarButtonItem *buttonOpenWith = [[UIBarButtonItem alloc] initWithImage:icon style:UIBarButtonItemStylePlain target:self action:@selector(openSelectedFiles)];
-    
-    UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"_cancel_", nil) style:UIBarButtonItemStylePlain target:self action:@selector(editingModeNO)];
-    
-    self.navigationItem.leftBarButtonItem = leftButton;
-    self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:buttonDelete, buttonOpenWith, nil];
-    
-    // Title
-    self.navigationItem.title = [NSString stringWithFormat:@"%@ : %lu / %lu", NSLocalizedString(@"_selected_", nil), (unsigned long)[selectedMetadatas count], (unsigned long)[sectionDataSource.allRecordsDataSource count]];
-}
-
-- (void)cellSelect:(BOOL)select indexPath:(NSIndexPath *)indexPath metadata:(tableMetadata *)metadata
-{
-    UICollectionViewCell *cell = [self.collectionView cellForItemAtIndexPath:indexPath];
-    UIVisualEffectView *effect = [cell viewWithTag:200];
-    UIImageView *checked = [cell viewWithTag:300];
-    
-    if (select) {
-        effect.hidden = NO;
-        effect.alpha = 0.4;
-        checked.hidden = NO;
-        [selectedMetadatas addObject:metadata];
-        
-    } else {
-        effect.hidden = YES;
-        checked.hidden = YES;
-        [selectedMetadatas removeObject:metadata];
-    }
-    
-    // Title
-    self.navigationItem.title = [NSString stringWithFormat:@"%@ : %lu / %lu", NSLocalizedString(@"_selected_", nil), (unsigned long)[selectedMetadatas count], (unsigned long)[sectionDataSource.allRecordsDataSource count]];
-}
-
-- (void)scrollToTop
-{
-    [self.collectionView setContentOffset:CGPointMake(0, - self.collectionView.contentInset.top) animated:NO];
-}
-
-- (void)getGeoLocationForSection:(NSInteger)section
-{
-    NSString *addLocation = @"";
-    
-    NSArray *fileIDsForKey = [sectionDataSource.sectionArrayRow objectForKey:[sectionDataSource.sections objectAtIndex:section]];
-    
-    for (NSString *fileID in fileIDsForKey) {
-    
-        tableLocalFile *localFile = [[NCManageDatabase sharedInstance] getTableLocalFileWithPredicate:[NSPredicate predicateWithFormat:@"fileID == %@", fileID]];
-    
-        if ([localFile.exifLatitude floatValue] > 0 || [localFile.exifLongitude floatValue] > 0) {
-        
-            NSString *location = [[NCManageDatabase sharedInstance] getLocationFromGeoLatitude:localFile.exifLatitude longitude:localFile.exifLongitude];
-            
-            addLocation = [NSString stringWithFormat:@"%@, %@", addLocation, location];
-        
-        }
-    }
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== DZNEmptyDataSetSource Methods ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView
-{
-    return [NCBrandColor sharedInstance].backgroundView;
-}
-
-- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView
-{
-    return [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"photosNoRecord"] multiplier:2 color:[NCBrandColor sharedInstance].graySoft];
-}
-
-- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView
-{
-    NSString *text;
-    
-    if (isSearchMode) {
-        text = [NSString stringWithFormat:@"\n%@", NSLocalizedString(@"_search_in_progress_", nil)];
-    } else {
-        text = [NSString stringWithFormat:@"\n%@", NSLocalizedString(@"_tutorial_photo_view_", nil)];
-    }
-    
-    NSDictionary *attributes = @{NSFontAttributeName:[UIFont boldSystemFontOfSize:20.0f], NSForegroundColorAttributeName:[UIColor lightGrayColor]};
-    
-    return [[NSAttributedString alloc] initWithString:text attributes:attributes];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== openSelectedFiles =====
-#pragma--------------------------------------------------------------------------------------------
-
-- (void)openSelectedFiles
-{
-    NSMutableArray *dataToShare = [[NSMutableArray alloc] init];
-    
-    for (tableMetadata *metadata in selectedMetadatas) {
-    
-        NSString *fileNamePath = [CCUtility getDirectoryProviderStorageFileID:metadata.fileID fileName:metadata.fileNameView];
-                
-        if ([CCUtility fileProviderStorageExists:metadata.fileID fileName:metadata.fileNameView]) {
-            
-            if ([metadata.typeFile isEqualToString: k_metadataTypeFile_image]) {
-                
-                NSData *data = [NSData dataWithData:UIImageJPEGRepresentation([UIImage imageWithContentsOfFile:fileNamePath], 0.9)];
-                [dataToShare addObject:data];
-            }
-            
-            if ([metadata.typeFile isEqualToString: k_metadataTypeFile_video]) {
-                
-                [dataToShare addObject:[NSURL fileURLWithPath:fileNamePath]];
-            }
-        }
-    }
-    
-    if ([dataToShare count] > 0) {
-        
-        UIActivityViewController* activityViewController = [[UIActivityViewController alloc] initWithActivityItems:dataToShare applicationActivities:nil];
-        
-        // iPad
-        activityViewController.popoverPresentationController.barButtonItem = self.navigationItem.rightBarButtonItems.lastObject;
-        
-        self.navigationItem.leftBarButtonItem.enabled = NO;
-        self.navigationItem.rightBarButtonItem.enabled = NO;
-        
-        [self presentViewController:activityViewController animated:YES completion:^{
-            
-            [activityViewController setCompletionWithItemsHandler:^(NSString *activityType, BOOL completed, NSArray *returnedItems, NSError *activityError) {
-                
-                self.navigationItem.leftBarButtonItem.enabled = YES;
-                self.navigationItem.rightBarButtonItem.enabled = YES;
-                
-                [self editingModeNO];
-
-                if (completed) {
-                    [self.collectionView reloadData];
-                }
-            }];
-        }];
-    }
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Download =====
-#pragma--------------------------------------------------------------------------------------------
-
-- (void)triggerProgressTask:(NSNotification *)notification
-{
-    //NSDictionary *dict = notification.userInfo;
-    //float progress = [[dict valueForKey:@"progress"] floatValue];
-}
-
-- (void)downloadFileSuccessFailure:(NSString *)fileName fileID:(NSString *)fileID serverUrl:(NSString *)serverUrl selector:(NSString *)selector errorMessage:(NSString *)errorMessage errorCode:(NSInteger)errorCode
-{
-    if (errorCode == 0) {
-        
-        NSIndexPath *indexPath;
-        BOOL existsIcon = NO;
-        
-        if (fileID) {
-            existsIcon = [[NSFileManager defaultManager] fileExistsAtPath:[CCUtility getDirectoryProviderStorageIconFileID:fileID fileNameView:fileName]];
-            indexPath = [sectionDataSource.fileIDIndexPath objectForKey:fileID];
-        }
-        
-        if ([self indexPathIsValid:indexPath] && existsIcon) {
-            
-            UICollectionViewCell *cell = [self.collectionView cellForItemAtIndexPath:indexPath];
-            
-            if (cell) {
-                UIImageView *imageView = (UIImageView *)[cell viewWithTag:100];
-                UIVisualEffectView *effect = [cell viewWithTag:200];
-                UIImageView *checked = [cell viewWithTag:300];
-                
-                imageView.image = [UIImage imageWithContentsOfFile:[CCUtility getDirectoryProviderStorageIconFileID:fileID fileNameView:fileName]];
-                effect.hidden = YES;
-                checked.hidden = YES;
-            }
-        }
-        
-    } else {
-        
-        [appDelegate messageNotification:@"_download_selected_files_" description:@"_error_download_photobrowser_" visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:errorCode];
-    }
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Delete =====
-#pragma--------------------------------------------------------------------------------------------
-
-- (void)deleteFile:(NSArray *)metadatas e2ee:(BOOL)e2ee
-{
-    [[NCMainCommon sharedInstance ] deleteFileWithMetadatas:metadatas e2ee:false serverUrl:@"" folderFileID:@"" completion:^(NSInteger errorCode, NSString *message) {
-        [self reloadDatasource];
-    }];
-    
-    [self editingModeNO];
-}
-
-- (void)deleteSelectedFiles
-{
-    if ([selectedMetadatas count] == 0)
-        return;
-    
-    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
-    
-    [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_delete_", nil)
-                                                         style:UIAlertActionStyleDestructive
-                                                       handler:^(UIAlertAction *action) {
-                                                           [self deleteFile:selectedMetadatas e2ee:false];
-                                                       }]];
-    
-    [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_", nil)
-                                                         style:UIAlertActionStyleCancel
-                                                       handler:^(UIAlertAction *action) {
-                                                       }]];
-    
-    alertController.popoverPresentationController.barButtonItem = self.navigationItem.rightBarButtonItems.firstObject;
-    
-    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
-        [alertController.view layoutIfNeeded];
-    
-    [self presentViewController:alertController animated:YES completion:NULL];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== Download Thumbnail ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)downloadThumbnail:(tableMetadata *)metadata indexPath:(NSIndexPath *)indexPath
-{
-    if (![saveDirectoryID isEqualToString:metadata.directoryID]) {
-        saveDirectoryID = metadata.directoryID;
-        saveServerUrl = [[NCManageDatabase sharedInstance] getServerUrl:metadata.directoryID];
-        if (!saveServerUrl)
-            return;
-    }
-    
-    counterThumbnail++;
-    
-    OCnetworking *ocNetworking = [[OCnetworking alloc] initWithDelegate:nil metadataNet:nil withUser:appDelegate.activeUser withUserID:appDelegate.activeUserID withPassword:appDelegate.activePassword withUrl:appDelegate.activeUrl];
-    [ocNetworking downloadThumbnailWithDimOfThumbnail:@"m" fileID:metadata.fileID fileNamePath:[CCUtility returnFileNamePathFromFileName:metadata.fileName serverUrl:saveServerUrl activeUrl:appDelegate.activeUrl] fileNameView:metadata.fileNameView completion:^(NSString *message, NSInteger errorCode) {
-        counterThumbnail--;
-        if (errorCode == 0 && [[NSFileManager defaultManager] fileExistsAtPath:[CCUtility getDirectoryProviderStorageIconFileID:metadata.fileID fileNameView:metadata.fileNameView]] && [self indexPathIsValid:indexPath] && !collectionViewReloadDataInProgress) {
-            [self.collectionView reloadItemsAtIndexPaths:@[indexPath]];
-        }
-    }];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== Change Start directory ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)moveServerUrlTo:(NSString *)serverUrlTo title:(NSString *)title
-{
-    NSString *oldStartDirectoryPhotosTab = [[NCManageDatabase sharedInstance] getAccountStartDirectoryPhotosTab:[CCUtility getHomeServerUrlActiveUrl:appDelegate.activeUrl]];
-    
-    if (![serverUrlTo isEqualToString:oldStartDirectoryPhotosTab]) {
-        
-        // Save Start Directory
-        [[NCManageDatabase sharedInstance] setAccountStartDirectoryPhotosTab:serverUrlTo];
-        
-        // search PhotoVideo with new start directory
-        [self searchPhotoVideo];
-    }
-}
-
-- (void)selectStartDirectoryPhotosTab
-{
-    UINavigationController* navigationController = [[UIStoryboard storyboardWithName:@"CCMove" bundle:nil] instantiateViewControllerWithIdentifier:@"CCMove"];
-    
-    CCMove *viewController = (CCMove *)navigationController.topViewController;
-    
-    viewController.delegate = self;
-    viewController.move.title = NSLocalizedString(@"_select_dir_photos_tab_", nil);
-    viewController.tintColor = [NCBrandColor sharedInstance].brandText;
-    viewController.barTintColor = [NCBrandColor sharedInstance].brand;
-    viewController.tintColorTitle = [NCBrandColor sharedInstance].brandText;
-    viewController.networkingOperationQueue = appDelegate.netQueue;
-    viewController.hideCreateFolder = YES;
-    // E2EE
-    viewController.includeDirectoryE2EEncryption = NO;
-    
-    [navigationController setModalPresentationStyle:UIModalPresentationFormSheet];
-    [self presentViewController:navigationController animated:YES completion:nil];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== Filter Image Video====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)buttonImageFilterYes
-{
-    filterTypeFileImage = YES;
-    if (filterTypeFileVideo == YES)
-        filterTypeFileVideo = NO;
-    [self reloadDatasource];
-}
-
-- (void)buttonImageFilterNo
-{
-    filterTypeFileImage = NO;
-    [self reloadDatasource];
-}
-
-- (void)buttonVideoFilterYes
-{
-    filterTypeFileVideo = YES;
-    if (filterTypeFileImage == YES)
-        filterTypeFileImage = NO;
-    [self reloadDatasource];
-}
-
-- (void)buttonVideoFilterNo
-{
-    filterTypeFileVideo = NO;
-    [self reloadDatasource];
-}
-
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== Search Photo/Video ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)searchSuccessFailure:(CCMetadataNet *)metadataNet metadatas:(NSArray *)metadatas message:(NSString *)message errorCode:(NSInteger)errorCode
-{
-    isSearchMode = NO;
-    
-    if (![metadataNet.account isEqualToString:appDelegate.activeAccount] || errorCode != 0) {
-        
-        [self reloadDatasource];
-        
-    } else {
-    
-        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
-            
-            // Clear all Hardcoded new foto/video from CCNetworking
-            [self.addMetadatasFromUpload removeAllObjects];
-            
-            [[NCManageDatabase sharedInstance] createTablePhotos:metadatas];
-
-            dispatch_async(dispatch_get_main_queue(), ^{
-                [self reloadDatasource];
-            });
-            
-            // Update date
-            [[NCManageDatabase sharedInstance] setAccountDateSearchContentTypeImageVideo:[NSDate date]];
-            // Save etag
-            [saveEtagForStartDirectory setObject:metadataNet.etag forKey:metadataNet.serverUrl];
-        });
-    }
-}
-
-- (void)searchPhotoVideo
-{
-    // test
-    if (appDelegate.activeAccount.length == 0 || isSearchMode)
-        return;
-    
-    // WAITING FOR d:creationdate
-    //
-    // tableAccount *account = [[NCManageDatabase sharedInstance] getAccountActive];
-    // account.dateSearchContentTypeImageVideo
-    
-    NSString *startDirectory = [[NCManageDatabase sharedInstance] getAccountStartDirectoryPhotosTab:[CCUtility getHomeServerUrlActiveUrl:appDelegate.activeUrl]];
-    OCnetworking *ocNetworking = [[OCnetworking alloc] initWithDelegate:self metadataNet:nil withUser:appDelegate.activeUser withUserID:appDelegate.activeUserID withPassword:appDelegate.activePassword withUrl:appDelegate.activeUrl];
-    
-    [ocNetworking readFile:nil serverUrl:startDirectory account:appDelegate.activeAccount success:^(tableMetadata *metadata) {
-        
-        if (![metadata.etag isEqualToString:[saveEtagForStartDirectory objectForKey:startDirectory]] || sectionDataSource.allRecordsDataSource.count == 0) {
-            
-            isSearchMode = YES;
-            [self editingModeNO];
-            
-            [[CCActions sharedInstance] search:startDirectory fileName:@"" etag:metadata.etag depth:@"infinity" date:[NSDate distantPast] contenType:@[@"image/%", @"video/%"] selector:selectorSearchContentType delegate:self];
-            
-        } else {
-            [self reloadDatasource];
-        }
-        
-    } failure:^(NSString *message, NSInteger errorCode) {
-    }];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== Datasource ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)reloadDatasource
-{
-    // test
-    if (appDelegate.activeAccount.length == 0) {
-        return;
-    }
-    
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-
-        collectionViewReloadDataInProgress = YES;
-        
-        NSArray *metadatas = [[NCManageDatabase sharedInstance] getTablePhotosWithAddMetadatasFromUpload:self.addMetadatasFromUpload];
-        sectionDataSource = [CCSectionMetadata creataDataSourseSectionMetadata:metadatas listProgressMetadata:nil groupByField:@"date" filterFileID:appDelegate.filterFileID filterTypeFileImage:filterTypeFileImage filterTypeFileVideo:filterTypeFileVideo activeAccount:appDelegate.activeAccount];
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-               
-            if (isEditMode)
-                [self setUINavigationBarSelected];
-            else
-                [self setUINavigationBarDefault];
-            
-            [self.collectionView reloadData];
-            
-            [self.collectionView performBatchUpdates:^{} completion:^(BOOL finished) {
-                collectionViewReloadDataInProgress = NO;
-            }];
-        });
-    });
-}
-
-- (void)editingModeYES
-{
-    [self.collectionView setAllowsMultipleSelection:true];
-    isEditMode = true;
-    [selectedMetadatas removeAllObjects];
-    [self setUINavigationBarSelected];
-
-    collectionViewReloadDataInProgress = YES;
-    [self.collectionView reloadData];
-    [self.collectionView performBatchUpdates:^{} completion:^(BOOL finished) {
-        collectionViewReloadDataInProgress = NO;
-    }];
-}
-
-- (void)editingModeNO
-{
-    [self.collectionView setAllowsMultipleSelection:false];
-    isEditMode = false;
-    [selectedMetadatas removeAllObjects];
-    [self setUINavigationBarDefault];
-    
-    collectionViewReloadDataInProgress = YES;
-    [self.collectionView reloadData];
-    [self.collectionView performBatchUpdates:^{} completion:^(BOOL finished) {
-        collectionViewReloadDataInProgress = NO;
-    }];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== Collection ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (BOOL)indexPathIsValid:(NSIndexPath *)indexPath
-{
-    return indexPath.section < [self numberOfSectionsInCollectionView:self.collectionView] && indexPath.row < [self collectionView:self.collectionView numberOfItemsInSection:indexPath.section];
-}
-
-- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
-{    
-    return [[sectionDataSource.sectionArrayRow allKeys] count];
-}
-
-- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
-{
-    return [[sectionDataSource.sectionArrayRow objectForKey:[sectionDataSource.sections objectAtIndex:section]] count];
-}
-
-- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
-{
-    UIInterfaceOrientation orientationOnLunch = [[UIApplication sharedApplication] statusBarOrientation];
-    
-    if (orientationOnLunch == UIInterfaceOrientationPortrait)
-        return CGSizeMake(collectionView.frame.size.width / 5.1f, collectionView.frame.size.width / 5.1f);
-    else
-        return CGSizeMake(collectionView.frame.size.width / 7.1f, collectionView.frame.size.width / 7.1f);
-}
-
--(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section
-{
-    if ([sectionDataSource.sections count] - 1 == section)
-        return CGSizeMake(collectionView.frame.size.width, 50);
-    
-    return CGSizeZero;
-}
-
-- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
-{
-    if (kind == UICollectionElementKindSectionHeader) {
-        
-        UICollectionReusableView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"header" forIndexPath:indexPath];
-        
-        //headerView.backgroundColor = COLOR_GROUPBY_BAR_NO_BLUR;
-        
-        [self getGeoLocationForSection:indexPath.section];
-        
-        UILabel *titleLabel = (UILabel *)[headerView viewWithTag:100];
-        titleLabel.textColor = [UIColor blackColor];
-        if (sectionDataSource.sections.count > indexPath.section)
-            titleLabel.text = [CCUtility getTitleSectionDate:[sectionDataSource.sections objectAtIndex:indexPath.section]];
-
-        return headerView;
-    }
-    
-    if (kind == UICollectionElementKindSectionFooter) {
-        
-        UICollectionReusableView *footerView = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"footer" forIndexPath:indexPath];
-        
-        UILabel *titleLabel = (UILabel *)[footerView viewWithTag:100];
-        titleLabel.textColor = [UIColor grayColor];
-        titleLabel.text = [NSString stringWithFormat:@"%lu %@, %lu %@", (long)sectionDataSource.image, NSLocalizedString(@"photo", nil), (long)sectionDataSource.video, NSLocalizedString(@"_video_", nil)];
-        
-        return footerView;
-    }
-    
-    return nil;
-}
-
-- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
-{
-    UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
-    UIImageView *imageView = (UIImageView *)[cell viewWithTag:100];
-    UIVisualEffectView *effect = [cell viewWithTag:200];
-
-    UIImageView *checkedOverlay = [cell viewWithTag:300];
-    checkedOverlay.image = [UIImage imageNamed:@"checked"];
-    
-    UIImageView *videoOverlay = [cell viewWithTag:400];
-    videoOverlay.image = [UIImage imageNamed:@"VideoOverlay"];
-
-    NSArray *metadatasForKey = [sectionDataSource.sectionArrayRow objectForKey:[sectionDataSource.sections objectAtIndex:indexPath.section]];
-    
-    if ([metadatasForKey count] > indexPath.row) {
-        
-        NSString *fileID = [metadatasForKey objectAtIndex:indexPath.row];
-        tableMetadata *metadata = [sectionDataSource.allRecordsDataSource objectForKey:fileID];
-    
-        // Image
-        if ([[NSFileManager defaultManager] fileExistsAtPath:[CCUtility getDirectoryProviderStorageIconFileID:metadata.fileID fileNameView:metadata.fileNameView]]) {
-        
-            // insert Image
-            imageView.image = [UIImage imageWithContentsOfFile:[CCUtility getDirectoryProviderStorageIconFileID:metadata.fileID fileNameView:metadata.fileNameView]];
-        
-        } else {
-        
-            imageView.image = [UIImage imageNamed:@"file_photo"];
-
-            if (metadata.thumbnailExists) {
-                [self downloadThumbnail:metadata indexPath:indexPath];
-            }
-        }
-    
-        // Cheched Overlay
-        if (cell.selected) {
-            checkedOverlay.hidden = NO;
-            effect.hidden = NO;
-            effect.alpha = 0.4;
-        } else {
-            checkedOverlay.hidden = YES;
-            effect.hidden = YES;
-        }
-        
-        // Video Overlay
-        if ([metadata.typeFile isEqualToString: k_metadataTypeFile_video]) {
-            videoOverlay.hidden = NO;
-        } else {
-            videoOverlay.hidden = YES;
-        }
-    }
-    
-    return cell;
-}
-
-- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
-{
-    NSArray *metadatasForKey = [sectionDataSource.sectionArrayRow objectForKey:[sectionDataSource.sections objectAtIndex:indexPath.section]];
-    
-    if ([metadatasForKey count] > indexPath.row) {
-        
-        NSString *fileID = [metadatasForKey objectAtIndex:indexPath.row];
-        self.metadata = [sectionDataSource.allRecordsDataSource objectForKey:fileID];
-        
-        if (isEditMode) {
-        
-            [self cellSelect:YES indexPath:indexPath metadata:self.metadata];
-        
-        } else {
-        
-            if ([self shouldPerformSegue])
-                [self performSegueWithIdentifier:@"segueDetail" sender:self];
-        }
-    }
-}
-
-- (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath
-{
-    // test
-    if (isEditMode == NO)
-        return;
-   
-    NSArray *metadatasForKey = [sectionDataSource.sectionArrayRow objectForKey:[sectionDataSource.sections objectAtIndex:indexPath.section]];
-    
-    if ([metadatasForKey count] > indexPath.row) {
-        
-        NSString *fileID = [metadatasForKey objectAtIndex:indexPath.row];
-        self.metadata = [sectionDataSource.allRecordsDataSource objectForKey:fileID];
-        
-        [self cellSelect:NO indexPath:indexPath metadata:self.metadata];
-    }
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Navigation ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (BOOL)shouldPerformSegue
-{
-    if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground)
-        return NO;
-    
-    // Not in first plain ? exit
-    if (self.view.window == NO)
-        return NO;
-    
-    // Collapsed but in first plain in detail exit
-    if (self.splitViewController.isCollapsed)
-        if (self.detailViewController.isViewLoaded && self.detailViewController.view.window)
-            return NO;
-    
-    // check if metadata is invalidated
-    if ([[NCManageDatabase sharedInstance] isTableInvalidated:self.metadata]) {
-        return NO;
-    }
-    
-    // ok perform segue
-    return YES;
-}
-
--(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
-{
-    id controller = segue.destinationViewController;
-    
-    if ([controller isKindOfClass:[UINavigationController class]]) {
-        UINavigationController *navigationController = controller;
-        self.detailViewController = (CCDetail *)navigationController.topViewController;
-    } else {
-        self.detailViewController = segue.destinationViewController;
-    }
-    
-    NSMutableArray *photoDataSource = [NSMutableArray new];
-    
-    for (NSString *fileID in sectionDataSource.allFileID) {
-        tableMetadata *metadata = [sectionDataSource.allRecordsDataSource objectForKey:fileID];
-        if ([metadata.typeFile isEqualToString: k_metadataTypeFile_image])
-            [photoDataSource addObject:metadata];
-    }
-    
-    self.detailViewController.photoDataSource = photoDataSource;
-    self.detailViewController.metadataDetail = self.metadata;
-    self.detailViewController.dateFilterQuery = self.metadata.date;
-    
-    [self.detailViewController setTitle:self.metadata.fileName];
-}
-
-@end

+ 1 - 1
iOSClient/Settings/CCManageAutoUpload.h

@@ -24,7 +24,7 @@
 #import "XLFormViewController.h"
 #import "CCMain.h"
 #import "CCManageLocation.h"
-#import "CCPhotos.h"
+#import "CCMedia.h"
 
 @interface CCManageAutoUpload : XLFormViewController
 

+ 1 - 1
iOSClient/Settings/CCManageAutoUpload.m

@@ -47,7 +47,7 @@
     return self;
 }
 
-// From Photos
+// From Media
 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
 {
     self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

+ 1 - 1
iOSClient/Settings/CCSettings.m

@@ -76,7 +76,7 @@
     
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"autoUpload" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_settings_autoupload_", nil)];
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
-    [row.cellConfig setObject:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"photos"] multiplier:2 color:[NCBrandColor sharedInstance].icon] forKey:@"imageView.image"];
+    [row.cellConfig setObject:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"media"] multiplier:2 color:[NCBrandColor sharedInstance].icon] forKey:@"imageView.image"];
     row.action.formSegueIdentifier = @"CCManageAutoUploadSegue";
     [section addFormRow:row];
 

+ 4 - 2
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -84,7 +84,8 @@
 "_success_"                 = "Success";
 "_initialization_"          = "Initialization";
 "_experimental_"            = "Experimental";
-"_select_dir_photos_tab_"   = "Select as folder \"Photos\"";
+"_select_dir_media_tab_"    = "Select as folder \"Media\"";
+
 
 // App
 
@@ -285,6 +286,7 @@
 // File
 
 "_photo_camera_"                = "Photos";
+"_media_"                       = "Media";
 "_unzip_in_progress_"           = "Extraction in progress on local storage…";
 "_file_unpacked_"               = "File unpacked on local storage";
 "_file_saved_local_"            = "File saved on local storage.";
@@ -484,7 +486,7 @@
 // CreateFormUploadAssets
 
 "_destination_folder_"              = "Destination folder";
-"_use_folder_photos_"               = "Use the Photos folder as destination";
+"_use_folder_media_"                = "Use the Media folder as destination";
 "_rename_filename_"                 = "Rename";
 "_filename_"                        = "Filename";
 "_preview_filename_"                = "Example preview of filename. You can use the mask %@ for date/time";