瀏覽代碼

change images

Marino Faggiana 6 年之前
父節點
當前提交
8f49dea994

+ 3 - 3
iOSClient/Images.xcassets/offlineFlag.imageset/Contents.json

@@ -2,17 +2,17 @@
   "images" : [
     {
       "idiom" : "universal",
-      "filename" : "flagOnDevice.png",
+      "filename" : "offlineFlag.png",
       "scale" : "1x"
     },
     {
       "idiom" : "universal",
-      "filename" : "flagOnDevice@2x.png",
+      "filename" : "offlineFlag@2x.png",
       "scale" : "2x"
     },
     {
       "idiom" : "universal",
-      "filename" : "flagOnDevice@3x.png",
+      "filename" : "offlineFlag@3x.png",
       "scale" : "3x"
     }
   ],

二進制
iOSClient/Images.xcassets/offlineFlag.imageset/flagOnDevice.png


二進制
iOSClient/Images.xcassets/offlineFlag.imageset/flagOnDevice@2x.png


二進制
iOSClient/Images.xcassets/offlineFlag.imageset/flagOnDevice@3x.png


二進制
iOSClient/Images.xcassets/offlineFlag.imageset/offlineFlag.png


二進制
iOSClient/Images.xcassets/offlineFlag.imageset/offlineFlag@2x.png


二進制
iOSClient/Images.xcassets/offlineFlag.imageset/offlineFlag@3x.png


+ 8 - 12
iOSClient/Main/NCMainCommon.swift

@@ -259,18 +259,16 @@ class NCMainCommon: NSObject {
                     cell.file.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "folder"), multiplier: 3, color: NCBrandColor.sharedInstance.brandElement)
                 }
                 
-                // Image Status Lock Passcode
+                // Status image: offline - passcode
                 let lockServerUrl = CCUtility.stringAppendServerUrl(serverUrl, addFileName: metadata.fileName)!
                 let tableDirectory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.activeAccount, lockServerUrl))
+                if tableDirectory != nil && tableDirectory!.offline {
+                    cell.status.image = UIImage.init(named: "offlineFlag")
+                }
                 if tableDirectory != nil && tableDirectory!.lock && CCUtility.getBlockCode() != nil {
                     cell.status.image = UIImage.init(named: "passcode")
                 }
                 
-                // Available offline
-                if tableDirectory != nil && tableDirectory!.offline {
-                    cell.favorite.image = UIImage.init(named: "offlineFlag")
-                }
-                
             } else {
                 
                 let iconFileExists = FileManager.default.fileExists(atPath: CCUtility.getDirectoryProviderStorageIconFileID(metadata.fileID, fileNameView: metadata.fileNameView))
@@ -295,17 +293,15 @@ class NCMainCommon: NSObject {
                     cell.local.image = UIImage.init(named: "local")
                 }
                 
-                // Status Image
+                // Status image: offline - encrypted
+                if tableLocalFile != nil && tableLocalFile!.offline {
+                    cell.status.image = UIImage.init(named: "offlineFlag")
+                }
                 let tableE2eEncryption = NCManageDatabase.sharedInstance.getE2eEncryption(predicate: NSPredicate(format: "account == %@ AND fileNameIdentifier == %@", appDelegate.activeAccount, metadata.fileName))
                 if tableE2eEncryption != nil &&  NCUtility.sharedInstance.isEncryptedMetadata(metadata) {
                     cell.status.image = UIImage.init(named: "encrypted")
                 }
                 
-                // Available offline
-                if tableLocalFile != nil && tableLocalFile!.offline {
-                    cell.favorite.image = UIImage.init(named: "offlineFlag")
-                }
-                
                 // Share
                 if (isShare) {
                     cell.shared.image =  CCGraphics.changeThemingColorImage(UIImage.init(named: "share"), multiplier: 2, color: NCBrandColor.sharedInstance.optionItem)

+ 13 - 7
iOSClient/Offline/NCOffline.swift

@@ -70,7 +70,7 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
         // Configure Refresh Control
         refreshControl.tintColor = NCBrandColor.sharedInstance.brandText
         refreshControl.backgroundColor = NCBrandColor.sharedInstance.brand
-        refreshControl.addTarget(self, action: #selector(loadDatasource(withSynchronized:)), for: .valueChanged)
+        refreshControl.addTarget(self, action: #selector(loadDatasource), for: .valueChanged)
         
         // empty Data Source
         self.collectionView.emptyDataSetDelegate = self;
@@ -85,7 +85,7 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
         datasourceSorted = CCUtility.getOrderSettings()
         datasourceAscending = CCUtility.getAscendingSettings()
         
-        loadDatasource(withSynchronized: false)
+        loadDatasource()
     }
     
     override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
@@ -264,7 +264,7 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
                     } else {
                         NCManageDatabase.sharedInstance.setLocalFile(fileID: metadata.fileID, offline: false)
                     }
-                    self.loadDatasource(withSynchronized: false)
+                    self.loadDatasource()
                 }
                 if item.value as? Int == 1 { self.appDelegate.activeMain.openWindowShare(metadata) }
                 if item.value as? Int == 2 {  }
@@ -307,7 +307,7 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
             datasourceSorted = CCUtility.getOrderSettings()
             datasourceAscending = CCUtility.getAscendingSettings()
             
-            loadDatasource(withSynchronized: false)
+            loadDatasource()
         }
         
         if dropdownMenu.token == "tapMoreHeaderMenu" {
@@ -333,19 +333,21 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
     }
     
     // MARK: DATASOURCE
-    @objc func loadDatasource(withSynchronized: Bool = false) {
+    @objc func loadDatasource() {
         
         datasource.removeAll()
         
         if directoryID == "" {
         
+            var metadatas = [tableMetadata]()
+
             let directories = NCManageDatabase.sharedInstance.getTablesDirectory(predicate: NSPredicate(format: "account == %@ AND offline == true", appDelegate.activeAccount), sorted: "serverUrl", ascending: true)
             if directories != nil {
                 for directory: tableDirectory in directories! {
                     guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileID == %@", directory.fileID)) else {
                         continue
                     }
-                    datasource.append(metadata)
+                    metadatas.append(metadata)
                 }
             }
             
@@ -355,10 +357,14 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
                     guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileID == %@", file.fileID)) else {
                         continue
                     }
-                    datasource.append(metadata)
+                    metadatas.append(metadata)
                 }
             }
             
+            //let sectionDataSource = CCSectionMetadata.creataDataSourseSectionMetadata(metadatas, listProgressMetadata: nil, groupByField: "", filterFileID: nil, filterTypeFileImage: false, filterTypeFileVideo: false, activeAccount: appDelegate.activeAccount) as CCSectionDataSourceMetadata
+            
+            datasource = metadatas
+            
         } else {
         
             if let metadatas = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "account == %@ AND directoryID == %@", appDelegate.activeAccount, directoryID), sorted: self.datasourceSorted, ascending: self.datasourceAscending)  {