Browse Source

clear code

marinofaggiana 4 years ago
parent
commit
b661eaab6d

+ 61 - 2
iOSClient/Brand/NCBrand.swift

@@ -101,8 +101,37 @@ class NCBrandColor: NSObject {
     @objc static let shared: NCBrandColor = {
         let instance = NCBrandColor()
         instance.setDarkMode()
+        instance.createImagesThemingColor()
         return instance
     }()
+    
+    struct cacheImages {
+        static var file = UIImage()
+
+        static var shared = UIImage()
+        static var canShare = UIImage()
+        static var shareByLink = UIImage()
+        
+        static var favorite = UIImage()
+        static var comment = UIImage()
+        static var livePhoto = UIImage()
+        static var offlineFlag = UIImage()
+        static var local = UIImage()
+
+        static var folderEncrypted = UIImage()
+        static var folderSharedWithMe = UIImage()
+        static var folderPublic = UIImage()
+        static var folderGroup = UIImage()
+        static var folderExternal = UIImage()
+        static var folderAutomaticUpload = UIImage()
+        static var folder = UIImage()
+        
+        static var checkedYes = UIImage()
+        static var checkedNo = UIImage()
+        
+        static var buttonMore = UIImage()
+        static var buttonStop = UIImage()
+    }
 
     // Color
     @objc public let customer:              UIColor = UIColor(red: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 1.0)    // BLU NC : #0082c9
@@ -135,6 +164,36 @@ class NCBrandColor: NSObject {
         self.brandText = self.customerText        
     }
     
+    private func createImagesThemingColor() {
+        
+        cacheImages.file = UIImage.init(named: "file")!
+        
+        cacheImages.shared = UIImage(named: "share")!.image(color: graySoft, size: 50)
+        cacheImages.canShare = UIImage(named: "share")!.image(color: graySoft, size: 50)
+        cacheImages.shareByLink = UIImage(named: "sharebylink")!.image(color: graySoft, size: 50)
+        
+        cacheImages.favorite = NCUtility.shared.loadImage(named: "star.fill", color: yellowFavorite)
+        cacheImages.comment = UIImage(named: "comment")!.image(color: graySoft, size: 50)
+        cacheImages.livePhoto = NCUtility.shared.loadImage(named: "livephoto", color: textView)
+        cacheImages.offlineFlag = UIImage.init(named: "offlineFlag")!
+        cacheImages.local = UIImage.init(named: "local")!
+            
+        let folderWidth: CGFloat = UIScreen.main.bounds.width / 3
+        cacheImages.folderEncrypted = UIImage(named: "folderEncrypted")!.image(color: brandElement, size: folderWidth)
+        cacheImages.folderSharedWithMe = UIImage(named: "folder_shared_with_me")!.image(color: brandElement, size: folderWidth)
+        cacheImages.folderPublic = UIImage(named: "folder_public")!.image(color: brandElement, size: folderWidth)
+        cacheImages.folderGroup = UIImage(named: "folder_group")!.image(color: brandElement, size: folderWidth)
+        cacheImages.folderExternal = UIImage(named: "folder_external")!.image(color: brandElement, size: folderWidth)
+        cacheImages.folderAutomaticUpload = UIImage(named: "folderAutomaticUpload")!.image(color: brandElement, size: folderWidth)
+        cacheImages.folder =  UIImage(named: "folder")!.image(color: brandElement, size: folderWidth)
+        
+        cacheImages.checkedYes = NCUtility.shared.loadImage(named: "checkmark.circle.fill", color: .darkGray)
+        cacheImages.checkedNo = NCUtility.shared.loadImage(named: "circle", color: graySoft)
+        
+        cacheImages.buttonMore = UIImage(named: "more")!.image(color: graySoft, size: 50)
+        cacheImages.buttonStop = UIImage(named: "stop")!.image(color: graySoft, size: 50)
+    }
+    
     @objc public func setDarkMode() {
         let darkMode = CCUtility.getDarkMode()
         if darkMode {
@@ -157,7 +216,7 @@ class NCBrandColor: NSObject {
     }
     
 #if !EXTENSION
-    @objc public func settingThemingColor(account: String) {
+    public func settingThemingColor(account: String) {
         
         let darker: CGFloat = 30    // %
         let lighter: CGFloat = 30   // %
@@ -203,7 +262,7 @@ class NCBrandColor: NSObject {
         setDarkMode()
         
         DispatchQueue.main.async {
-            NCCollectionCommon.shared.createImagesThemingColor()
+            self.createImagesThemingColor()
             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterChangeTheming)
         }
     }

+ 0 - 61
iOSClient/Main/Collection Common/NCCollectionCommon.swift

@@ -27,71 +27,10 @@ import NCCommunication
 class NCCollectionCommon: NSObject, NCSelectDelegate {
     @objc static let shared: NCCollectionCommon = {
         let instance = NCCollectionCommon()
-        instance.createImagesThemingColor()
         return instance
     }()
     
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
-
-    struct images {
-        static var file = UIImage()
-
-        static var shared = UIImage()
-        static var canShare = UIImage()
-        static var shareByLink = UIImage()
-        
-        static var favorite = UIImage()
-        static var comment = UIImage()
-        static var livePhoto = UIImage()
-        static var offlineFlag = UIImage()
-        static var local = UIImage()
-
-        static var folderEncrypted = UIImage()
-        static var folderSharedWithMe = UIImage()
-        static var folderPublic = UIImage()
-        static var folderGroup = UIImage()
-        static var folderExternal = UIImage()
-        static var folderAutomaticUpload = UIImage()
-        static var folder = UIImage()
-        
-        static var checkedYes = UIImage()
-        static var checkedNo = UIImage()
-        
-        static var buttonMore = UIImage()
-        static var buttonStop = UIImage()
-    }
-    
-    // MARK: -
-    
-    func createImagesThemingColor() {
-        
-        images.file = UIImage.init(named: "file")!
-        
-        images.shared = UIImage(named: "share")!.image(color: NCBrandColor.shared.graySoft, size: 50)
-        images.canShare = UIImage(named: "share")!.image(color: NCBrandColor.shared.graySoft, size: 50)
-        images.shareByLink = UIImage(named: "sharebylink")!.image(color: NCBrandColor.shared.graySoft, size: 50)
-        
-        images.favorite = NCUtility.shared.loadImage(named: "star.fill", color: NCBrandColor.shared.yellowFavorite)
-        images.comment = UIImage(named: "comment")!.image(color: NCBrandColor.shared.graySoft, size: 50)
-        images.livePhoto = NCUtility.shared.loadImage(named: "livephoto", color: NCBrandColor.shared.textView)
-        images.offlineFlag = UIImage.init(named: "offlineFlag")!
-        images.local = UIImage.init(named: "local")!
-            
-        let folderWidth: CGFloat = UIScreen.main.bounds.width / 3
-        images.folderEncrypted = UIImage(named: "folderEncrypted")!.image(color: NCBrandColor.shared.brandElement, size: folderWidth)
-        images.folderSharedWithMe = UIImage(named: "folder_shared_with_me")!.image(color: NCBrandColor.shared.brandElement, size: folderWidth)
-        images.folderPublic = UIImage(named: "folder_public")!.image(color: NCBrandColor.shared.brandElement, size: folderWidth)
-        images.folderGroup = UIImage(named: "folder_group")!.image(color: NCBrandColor.shared.brandElement, size: folderWidth)
-        images.folderExternal = UIImage(named: "folder_external")!.image(color: NCBrandColor.shared.brandElement, size: folderWidth)
-        images.folderAutomaticUpload = UIImage(named: "folderAutomaticUpload")!.image(color: NCBrandColor.shared.brandElement, size: folderWidth)
-        images.folder =  UIImage(named: "folder")!.image(color: NCBrandColor.shared.brandElement, size: folderWidth)
-        
-        images.checkedYes = NCUtility.shared.loadImage(named: "checkmark.circle.fill", color: .darkGray) //UIImage(named: "checkedYes")!.image(color: .darkGray, size: 50)
-        images.checkedNo = NCUtility.shared.loadImage(named: "circle", color: NCBrandColor.shared.graySoft) //UIImage(named: "checkedNo")!.image(color: NCBrandColor.shared.graySoft, size: 50)
-        
-        images.buttonMore = UIImage(named: "more")!.image(color: NCBrandColor.shared.graySoft, size: 50)
-        images.buttonStop = UIImage(named: "stop")!.image(color: NCBrandColor.shared.graySoft, size: 50)
-    }
     
     // MARK: - NCSelect + Delegate
     

+ 39 - 39
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -520,7 +520,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                             if progress > 0 {
                                 cell.progressView?.isHidden = false
                                 cell.progressView?.progress = progress
-                                cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCCollectionCommon.images.buttonStop)
+                                cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
                                 if status == NCGlobal.shared.metadataStatusInDownload {
                                     cell.labelInfo.text = CCUtility.transformedSize(totalBytesExpected) + " - ↓ " + CCUtility.transformedSize(totalBytes)
                                 } else if status == NCGlobal.shared.metadataStatusInUpload {
@@ -532,7 +532,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                             if progress > 0 {
                                 cell.progressView?.isHidden = false
                                 cell.progressView?.progress = progress
-                                cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCCollectionCommon.images.buttonStop)
+                                cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
                                 if status == NCGlobal.shared.metadataStatusInDownload {
                                     cell.labelInfo.text = CCUtility.transformedSize(totalBytesExpected) + " - ↓ " + CCUtility.transformedSize(totalBytes)
                                 } else if status == NCGlobal.shared.metadataStatusInUpload {
@@ -544,7 +544,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                             if progress > 0 {
                                 cell.progressView.isHidden = false
                                 cell.progressView.progress = progress
-                                cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCCollectionCommon.images.buttonStop)
+                                cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
                             }
                         }
                     }
@@ -1202,21 +1202,21 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
             if metadata.directory {
                 
                 if metadata.e2eEncrypted {
-                    cell.imageItem.image = NCCollectionCommon.images.folderEncrypted
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderEncrypted
                 } else if isShare {
-                    cell.imageItem.image = NCCollectionCommon.images.folderSharedWithMe
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderSharedWithMe
                 } else if (tableShare != nil && tableShare?.shareType != 3) {
-                    cell.imageItem.image = NCCollectionCommon.images.folderSharedWithMe
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderSharedWithMe
                 } else if (tableShare != nil && tableShare?.shareType == 3) {
-                    cell.imageItem.image = NCCollectionCommon.images.folderPublic
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderPublic
                 } else if metadata.mountType == "group" {
-                    cell.imageItem.image = NCCollectionCommon.images.folderGroup
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderGroup
                 } else if isMounted {
-                    cell.imageItem.image = NCCollectionCommon.images.folderExternal
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderExternal
                 } else if metadata.fileName == autoUploadFileName && metadata.serverUrl == autoUploadDirectory {
-                    cell.imageItem.image = NCCollectionCommon.images.folderAutomaticUpload
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderAutomaticUpload
                 } else {
-                    cell.imageItem.image = NCCollectionCommon.images.folder
+                    cell.imageItem.image = NCBrandColor.cacheImages.folder
                 }
                 
                 cell.labelInfo.text = CCUtility.dateDiff(metadata.date as Date)
@@ -1226,7 +1226,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
                 
                 // Local image: offline
                 if tableDirectory != nil && tableDirectory!.offline {
-                    cell.imageLocal.image = NCCollectionCommon.images.offlineFlag
+                    cell.imageLocal.image = NCBrandColor.cacheImages.offlineFlag
                 }
                 
             } else {
@@ -1240,7 +1240,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
                         if metadata.iconName.count > 0 {
                             cell.imageItem.image = UIImage.init(named: metadata.iconName)
                         } else {
-                            cell.imageItem.image = NCCollectionCommon.images.file
+                            cell.imageItem.image = NCBrandColor.cacheImages.file
                         }
                     }
                 }
@@ -1249,26 +1249,26 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
                                 
                 // image local
                 if dataSource.metadataOffLine.contains(metadata.ocId) {
-                    cell.imageLocal.image = NCCollectionCommon.images.offlineFlag
+                    cell.imageLocal.image = NCBrandColor.cacheImages.offlineFlag
                 } else if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
-                    cell.imageLocal.image = NCCollectionCommon.images.local
+                    cell.imageLocal.image = NCBrandColor.cacheImages.local
                 }
             }
             
             // image Favorite
             if metadata.favorite {
-                cell.imageFavorite.image = NCCollectionCommon.images.favorite
+                cell.imageFavorite.image = NCBrandColor.cacheImages.favorite
             }
             
             // Share image
             if (isShare) {
-                cell.imageShared.image = NCCollectionCommon.images.shared
+                cell.imageShared.image = NCBrandColor.cacheImages.shared
             } else if (tableShare != nil && tableShare?.shareType == 3) {
-                cell.imageShared.image = NCCollectionCommon.images.shareByLink
+                cell.imageShared.image = NCBrandColor.cacheImages.shareByLink
             } else if (tableShare != nil && tableShare?.shareType != 3) {
-                cell.imageShared.image = NCCollectionCommon.images.shared
+                cell.imageShared.image = NCBrandColor.cacheImages.shared
             } else {
-                cell.imageShared.image = NCCollectionCommon.images.canShare
+                cell.imageShared.image = NCBrandColor.cacheImages.canShare
             }
             if metadata.ownerId.count > 0 && metadata.ownerId != appDelegate.userId {
                 var fileNameUser = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(appDelegate.user, urlBase: appDelegate.urlBase) + "-" + metadata.ownerId
@@ -1295,11 +1295,11 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
             }
             if metadata.status == NCGlobal.shared.metadataStatusInDownload || metadata.status == NCGlobal.shared.metadataStatusDownloading ||  metadata.status >= NCGlobal.shared.metadataStatusTypeUpload {
                 cell.progressView.isHidden = false
-                cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCCollectionCommon.images.buttonStop)
+                cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
             } else {
                 cell.progressView.isHidden = true
                 cell.progressView.progress = progress
-                cell.setButtonMore(named: NCGlobal.shared.buttonMoreMore, image: NCCollectionCommon.images.buttonMore)
+                cell.setButtonMore(named: NCGlobal.shared.buttonMoreMore, image: NCBrandColor.cacheImages.buttonMore)
             }
             // Write status on Label Info
             switch metadata.status {
@@ -1327,7 +1327,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
             
             // Live Photo
             if metadata.livePhoto {
-                cell.imageStatus.image = NCCollectionCommon.images.livePhoto
+                cell.imageStatus.image = NCBrandColor.cacheImages.livePhoto
             }
             
             // E2EE
@@ -1390,21 +1390,21 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
             if metadata.directory {
                 
                 if metadata.e2eEncrypted {
-                    cell.imageItem.image = NCCollectionCommon.images.folderEncrypted
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderEncrypted
                 } else if isShare {
-                    cell.imageItem.image = NCCollectionCommon.images.folderSharedWithMe
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderSharedWithMe
                 } else if (tableShare != nil && tableShare!.shareType != 3) {
-                    cell.imageItem.image = NCCollectionCommon.images.folderSharedWithMe
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderSharedWithMe
                 } else if (tableShare != nil && tableShare!.shareType == 3) {
-                    cell.imageItem.image = NCCollectionCommon.images.folderPublic
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderPublic
                 } else if metadata.mountType == "group" {
-                    cell.imageItem.image = NCCollectionCommon.images.folderGroup
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderGroup
                 } else if isMounted {
-                    cell.imageItem.image = NCCollectionCommon.images.folderExternal
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderExternal
                 } else if metadata.fileName == autoUploadFileName && metadata.serverUrl == autoUploadDirectory {
-                    cell.imageItem.image = NCCollectionCommon.images.folderAutomaticUpload
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderAutomaticUpload
                 } else {
-                    cell.imageItem.image = NCCollectionCommon.images.folder
+                    cell.imageItem.image = NCBrandColor.cacheImages.folder
                 }
     
                 let lockServerUrl = CCUtility.stringAppendServerUrl(metadata.serverUrl, addFileName: metadata.fileName)!
@@ -1412,7 +1412,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
                                 
                 // Local image: offline
                 if tableDirectory != nil && tableDirectory!.offline {
-                    cell.imageLocal.image = NCCollectionCommon.images.offlineFlag
+                    cell.imageLocal.image = NCBrandColor.cacheImages.offlineFlag
                 }
                 
             } else {
@@ -1426,37 +1426,37 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
                         if metadata.iconName.count > 0 {
                             cell.imageItem.image = UIImage.init(named: metadata.iconName)
                         } else {
-                            cell.imageItem.image = NCCollectionCommon.images.file
+                            cell.imageItem.image = NCBrandColor.cacheImages.file
                         }
                     }
                 }
                 
                 // image Local
                 if dataSource.metadataOffLine.contains(metadata.ocId) {
-                    cell.imageLocal.image = NCCollectionCommon.images.offlineFlag
+                    cell.imageLocal.image = NCBrandColor.cacheImages.offlineFlag
                 } else if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
-                    cell.imageLocal.image = NCCollectionCommon.images.local
+                    cell.imageLocal.image = NCBrandColor.cacheImages.local
                 }
             }
             
             // image Favorite
             if metadata.favorite {
-                cell.imageFavorite.image = NCCollectionCommon.images.favorite
+                cell.imageFavorite.image = NCBrandColor.cacheImages.favorite
             }
             
             // Transfer
             if metadata.status == NCGlobal.shared.metadataStatusInDownload || metadata.status == NCGlobal.shared.metadataStatusDownloading ||  metadata.status >= NCGlobal.shared.metadataStatusTypeUpload {
                 cell.progressView.isHidden = false
-                cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCCollectionCommon.images.buttonStop)
+                cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
             } else {
                 cell.progressView.isHidden = true
                 cell.progressView.progress = 0.0
-                cell.setButtonMore(named: NCGlobal.shared.buttonMoreMore, image: NCCollectionCommon.images.buttonMore)
+                cell.setButtonMore(named: NCGlobal.shared.buttonMoreMore, image: NCBrandColor.cacheImages.buttonMore)
             }
             
             // Live Photo
             if metadata.livePhoto {
-                cell.imageStatus.image = NCCollectionCommon.images.livePhoto
+                cell.imageStatus.image = NCBrandColor.cacheImages.livePhoto
             }
             
             // Edit mode

+ 1 - 1
iOSClient/Main/Collection Common/NCGridCell.swift

@@ -113,7 +113,7 @@ class NCGridCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCImageCell
     
     func selected(_ status: Bool) {
         if status {
-            imageSelect.image = NCCollectionCommon.images.checkedYes
+            imageSelect.image = NCBrandColor.cacheImages.checkedYes
             imageVisualEffect.isHidden = false
             imageVisualEffect.alpha = 0.4
         } else {

+ 2 - 2
iOSClient/Main/Collection Common/NCListCell.swift

@@ -131,7 +131,7 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCImageCell
     
     func selected(_ status: Bool) {
         if status {
-            imageSelect.image = NCCollectionCommon.images.checkedYes
+            imageSelect.image = NCBrandColor.cacheImages.checkedYes
             
             let blurEffect = UIBlurEffect(style: .extraLight)
             let blurEffectView = UIVisualEffectView(effect: blurEffect)
@@ -142,7 +142,7 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCImageCell
             
             separator.isHidden = true
         } else {
-            imageSelect.image = NCCollectionCommon.images.checkedNo
+            imageSelect.image = NCBrandColor.cacheImages.checkedNo
             backgroundView = nil
             separator.isHidden = false
         }

+ 1 - 1
iOSClient/Media/Cell/NCGridMediaCell.swift

@@ -76,7 +76,7 @@ class NCGridMediaCell: UICollectionViewCell, NCImageCellProtocol {
     
     func selected(_ status: Bool) {
         if status {
-            imageSelect.image = NCCollectionCommon.images.checkedYes
+            imageSelect.image = NCBrandColor.cacheImages.checkedYes
             imageVisualEffect.isHidden = false
             imageVisualEffect.alpha = 0.4
         } else {

+ 1 - 1
iOSClient/Media/NCMedia.swift

@@ -416,7 +416,7 @@ extension NCMedia: UICollectionViewDataSource {
                 if metadata.iconName.count > 0 {
                     cell.imageItem.image = UIImage.init(named: metadata.iconName)
                 } else {
-                    cell.imageItem.image = NCCollectionCommon.images.file
+                    cell.imageItem.image = NCBrandColor.cacheImages.file
                 }
             }
             cell.date = metadata.date as Date

+ 2 - 2
iOSClient/Menu/NCCollectionViewCommon+Menu.swift

@@ -72,9 +72,9 @@ extension NCCollectionViewCommon {
             iconHeader = image!
         } else {
             if metadata.directory {
-                iconHeader = NCCollectionCommon.images.folder
+                iconHeader = NCBrandColor.cacheImages.folder
             } else {
-                iconHeader = NCCollectionCommon.images.file
+                iconHeader = NCBrandColor.cacheImages.file
             }
         }
         

+ 2 - 2
iOSClient/Rename file/NCRenameFile.swift

@@ -72,7 +72,7 @@ class NCRenameFile: UIViewController, UITextFieldDelegate {
             if metadata.directory {
                 
                 if imagePreview == nil {
-                    previewFile.image = NCCollectionCommon.images.folder
+                    previewFile.image = NCBrandColor.cacheImages.folder
                 }
                 
                 ext.isHidden = true
@@ -82,7 +82,7 @@ class NCRenameFile: UIViewController, UITextFieldDelegate {
             } else {
                 
                 if imagePreview == nil {
-                    previewFile.image = NCCollectionCommon.images.file
+                    previewFile.image = NCBrandColor.cacheImages.file
                 }
                 
                 fileNameWithoutExtTrailingContraint.constant = 90

+ 32 - 32
iOSClient/Select/NCSelect.swift

@@ -497,21 +497,21 @@ extension NCSelect: UICollectionViewDataSource {
             if metadata.directory {
                 
                 if metadata.e2eEncrypted {
-                    cell.imageItem.image = NCCollectionCommon.images.folderEncrypted
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderEncrypted
                 } else if isShare {
-                    cell.imageItem.image = NCCollectionCommon.images.folderSharedWithMe
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderSharedWithMe
                 } else if (tableShare != nil && tableShare?.shareType != 3) {
-                    cell.imageItem.image = NCCollectionCommon.images.folderSharedWithMe
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderSharedWithMe
                 } else if (tableShare != nil && tableShare?.shareType == 3) {
-                    cell.imageItem.image = NCCollectionCommon.images.folderPublic
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderPublic
                 } else if metadata.mountType == "group" {
-                    cell.imageItem.image = NCCollectionCommon.images.folderGroup
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderGroup
                 } else if isMounted {
-                    cell.imageItem.image = NCCollectionCommon.images.folderExternal
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderExternal
                 } else if metadata.fileName == autoUploadFileName && metadata.serverUrl == autoUploadDirectory {
-                    cell.imageItem.image = NCCollectionCommon.images.folderAutomaticUpload
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderAutomaticUpload
                 } else {
-                    cell.imageItem.image = NCCollectionCommon.images.folder
+                    cell.imageItem.image = NCBrandColor.cacheImages.folder
                 }
                 
                 cell.labelInfo.text = CCUtility.dateDiff(metadata.date as Date)
@@ -521,7 +521,7 @@ extension NCSelect: UICollectionViewDataSource {
                 
                 // Local image: offline
                 if tableDirectory != nil && tableDirectory!.offline {
-                    cell.imageLocal.image = NCCollectionCommon.images.offlineFlag
+                    cell.imageLocal.image = NCBrandColor.cacheImages.offlineFlag
                 }
                 
             } else {
@@ -535,7 +535,7 @@ extension NCSelect: UICollectionViewDataSource {
                         if metadata.iconName.count > 0 {
                             cell.imageItem.image = UIImage.init(named: metadata.iconName)
                         } else {
-                            cell.imageItem.image = NCCollectionCommon.images.file
+                            cell.imageItem.image = NCBrandColor.cacheImages.file
                         }
                     }
                 }
@@ -544,26 +544,26 @@ extension NCSelect: UICollectionViewDataSource {
                 
                 // image local
                 if dataSource.metadataOffLine.contains(metadata.ocId) {
-                    cell.imageLocal.image = NCCollectionCommon.images.offlineFlag
+                    cell.imageLocal.image = NCBrandColor.cacheImages.offlineFlag
                 } else if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
-                    cell.imageLocal.image = NCCollectionCommon.images.local
+                    cell.imageLocal.image = NCBrandColor.cacheImages.local
                 }
             }
             
             // image Favorite
             if metadata.favorite {
-                cell.imageFavorite.image = NCCollectionCommon.images.favorite
+                cell.imageFavorite.image = NCBrandColor.cacheImages.favorite
             }
             
             // Share image
             if (isShare) {
-                cell.imageShared.image = NCCollectionCommon.images.shared
+                cell.imageShared.image = NCBrandColor.cacheImages.shared
             } else if (tableShare != nil && tableShare?.shareType == 3) {
-                cell.imageShared.image = NCCollectionCommon.images.shareByLink
+                cell.imageShared.image = NCBrandColor.cacheImages.shareByLink
             } else if (tableShare != nil && tableShare?.shareType != 3) {
-                cell.imageShared.image = NCCollectionCommon.images.shared
+                cell.imageShared.image = NCBrandColor.cacheImages.shared
             } else {
-                cell.imageShared.image = NCCollectionCommon.images.canShare
+                cell.imageShared.image = NCBrandColor.cacheImages.canShare
             }
             if metadata.ownerId.count > 0 && metadata.ownerId != appDelegate.userId {
                 var fileNameUser = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(appDelegate.user, urlBase: appDelegate.urlBase) + "-" + metadata.ownerId
@@ -587,7 +587,7 @@ extension NCSelect: UICollectionViewDataSource {
     
             // Live Photo
             if metadata.livePhoto {
-                cell.imageStatus.image = NCCollectionCommon.images.livePhoto
+                cell.imageStatus.image = NCBrandColor.cacheImages.livePhoto
             }
             
             // Remove last separator
@@ -625,21 +625,21 @@ extension NCSelect: UICollectionViewDataSource {
             if metadata.directory {
                 
                 if metadata.e2eEncrypted {
-                    cell.imageItem.image = NCCollectionCommon.images.folderEncrypted
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderEncrypted
                 } else if isShare {
-                    cell.imageItem.image = NCCollectionCommon.images.folderSharedWithMe
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderSharedWithMe
                 } else if (tableShare != nil && tableShare!.shareType != 3) {
-                    cell.imageItem.image = NCCollectionCommon.images.folderSharedWithMe
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderSharedWithMe
                 } else if (tableShare != nil && tableShare!.shareType == 3) {
-                    cell.imageItem.image = NCCollectionCommon.images.folderPublic
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderPublic
                 } else if metadata.mountType == "group" {
-                    cell.imageItem.image = NCCollectionCommon.images.folderGroup
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderGroup
                 } else if isMounted {
-                    cell.imageItem.image = NCCollectionCommon.images.folderExternal
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderExternal
                 } else if metadata.fileName == autoUploadFileName && metadata.serverUrl == autoUploadDirectory {
-                    cell.imageItem.image = NCCollectionCommon.images.folderAutomaticUpload
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderAutomaticUpload
                 } else {
-                    cell.imageItem.image = NCCollectionCommon.images.folder
+                    cell.imageItem.image = NCBrandColor.cacheImages.folder
                 }
     
                 let lockServerUrl = CCUtility.stringAppendServerUrl(metadata.serverUrl, addFileName: metadata.fileName)!
@@ -647,7 +647,7 @@ extension NCSelect: UICollectionViewDataSource {
                                 
                 // Local image: offline
                 if tableDirectory != nil && tableDirectory!.offline {
-                    cell.imageLocal.image = NCCollectionCommon.images.offlineFlag
+                    cell.imageLocal.image = NCBrandColor.cacheImages.offlineFlag
                 }
                 
             } else {
@@ -661,22 +661,22 @@ extension NCSelect: UICollectionViewDataSource {
                         if metadata.iconName.count > 0 {
                             cell.imageItem.image = UIImage.init(named: metadata.iconName)
                         } else {
-                            cell.imageItem.image = NCCollectionCommon.images.file
+                            cell.imageItem.image = NCBrandColor.cacheImages.file
                         }
                     }
                 }
                 
                 // image Local
                 if dataSource.metadataOffLine.contains(metadata.ocId) {
-                    cell.imageLocal.image = NCCollectionCommon.images.offlineFlag
+                    cell.imageLocal.image = NCBrandColor.cacheImages.offlineFlag
                 } else if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
-                    cell.imageLocal.image = NCCollectionCommon.images.local
+                    cell.imageLocal.image = NCBrandColor.cacheImages.local
                 }
             }
             
             // image Favorite
             if metadata.favorite {
-                cell.imageFavorite.image = NCCollectionCommon.images.favorite
+                cell.imageFavorite.image = NCBrandColor.cacheImages.favorite
             }
             
             cell.imageSelect.isHidden = true
@@ -685,7 +685,7 @@ extension NCSelect: UICollectionViewDataSource {
 
             // Live Photo
             if metadata.livePhoto {
-                cell.imageStatus.image = NCCollectionCommon.images.livePhoto
+                cell.imageStatus.image = NCBrandColor.cacheImages.livePhoto
             }
             
             return cell

+ 2 - 2
iOSClient/Transfers/NCTransfers.swift

@@ -187,7 +187,7 @@ class NCTransfers: NCCollectionViewCommon, NCTransferCellDelegate  {
         if pathText == "" { pathText = "/" }
         cell.labelPath.text = pathText
         
-        cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCCollectionCommon.images.buttonStop)
+        cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
 
         cell.progressView.progress = 0.0
         cell.separator.backgroundColor = NCBrandColor.shared.separator
@@ -199,7 +199,7 @@ class NCTransfers: NCCollectionViewCommon, NCTransferCellDelegate  {
         }
         
         if cell.imageItem.image == nil {
-            cell.imageItem.image = NCCollectionCommon.images.file
+            cell.imageItem.image = NCBrandColor.cacheImages.file
         }
         
         cell.labelInfo.text = CCUtility.dateDiff(metadata.date as Date) + " · " + CCUtility.transformedSize(metadata.size)

+ 2 - 2
iOSClient/Trash/Cell/NCTrashListCell.swift

@@ -79,7 +79,7 @@ class NCTrashListCell: UICollectionViewCell {
     
     func selected(_ status: Bool) {
         if status {
-            imageSelect.image = NCCollectionCommon.images.checkedYes
+            imageSelect.image = NCBrandColor.cacheImages.checkedYes
             
             let blurEffect = UIBlurEffect(style: .extraLight)
             let blurEffectView = UIVisualEffectView(effect: blurEffect)
@@ -89,7 +89,7 @@ class NCTrashListCell: UICollectionViewCell {
             backgroundView = blurEffectView
             
         } else {
-            imageSelect.image = NCCollectionCommon.images.checkedNo
+            imageSelect.image = NCBrandColor.cacheImages.checkedNo
             backgroundView = nil
         }
     }

+ 2 - 2
iOSClient/Trash/NCTrash.swift

@@ -320,7 +320,7 @@ extension NCTrash: UICollectionViewDataSource {
             cell.separator.backgroundColor = NCBrandColor.shared.separator
 
             if tableTrash.directory {
-                cell.imageItem.image = NCCollectionCommon.images.folder
+                cell.imageItem.image = NCBrandColor.cacheImages.folder
                 cell.labelInfo.text = CCUtility.dateDiff(tableTrash.date as Date)
             } else {
                 cell.imageItem.image = image
@@ -352,7 +352,7 @@ extension NCTrash: UICollectionViewDataSource {
             cell.labelTitle.textColor = NCBrandColor.shared.textView
             
             if tableTrash.directory {
-                cell.imageItem.image = NCCollectionCommon.images.folder
+                cell.imageItem.image = NCBrandColor.cacheImages.folder
             } else {
                 cell.imageItem.image = image
             }