Marino Faggiana 6 anni fa
parent
commit
661365e90f

+ 23 - 0
iOSClient/Images.xcassets/flagOnDevice.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "flagOnDevice.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "flagOnDevice@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "flagOnDevice@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/flagOnDevice.imageset/flagOnDevice.png


BIN
iOSClient/Images.xcassets/flagOnDevice.imageset/flagOnDevice@2x.png


BIN
iOSClient/Images.xcassets/flagOnDevice.imageset/flagOnDevice@3x.png


BIN
iOSClient/Images.xcassets/onDevice.imageset/onDevice.png


BIN
iOSClient/Images.xcassets/onDevice.imageset/onDevice@2x.png


BIN
iOSClient/Images.xcassets/onDevice.imageset/onDevice@3x.png


+ 3 - 0
iOSClient/Main/CCMain.m

@@ -3602,6 +3602,7 @@
                                             [[CCSynchronize sharedSynchronize] readFolder:dirServerUrl selector:selectorReadFolderWithDownload];
                                         } else if (directoryOnDevice.serverUrl.length == dirServerUrl.length) {
                                             [[NCManageDatabase sharedInstance] setDirectoryWithServerUrl:dirServerUrl onDevice:false];
+                                            [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
                                         } else if (directoryOnDevice.serverUrl.length > dirServerUrl.length) {
                                             [[NCManageDatabase sharedInstance] setDirectoryWithServerUrl:directoryOnDevice.serverUrl onDevice:false];
                                             [[NCManageDatabase sharedInstance] setDirectoryWithServerUrl:dirServerUrl onDevice:true];
@@ -3806,8 +3807,10 @@
                                             [[NCMainCommon sharedInstance] reloadDatasourceWithServerUrl:self.serverUrl fileID:self.metadata.fileID action:k_action_MOD];
                                         } else if (localFile.onDevice == false) {
                                             [[NCManageDatabase sharedInstance] setLocalFileWithFileID:self.metadata.fileID onDevice:true];
+                                            [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
                                         } else {
                                             [[NCManageDatabase sharedInstance] setLocalFileWithFileID:self.metadata.fileID onDevice:false];
+                                            [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
                                         }
                                     }];
         }

+ 10 - 0
iOSClient/Main/NCMainCommon.swift

@@ -266,6 +266,11 @@ class NCMainCommon: NSObject {
                     cell.status.image = UIImage.init(named: "passcode")
                 }
                 
+                // Available offline
+                if tableDirectory != nil && tableDirectory!.onDevice {
+                    cell.favorite.image = UIImage.init(named: "flagOnDevice")
+                }
+                
             } else {
                 
                 let iconFileExists = FileManager.default.fileExists(atPath: CCUtility.getDirectoryProviderStorageIconFileID(metadata.fileID, fileNameView: metadata.fileNameView))
@@ -296,6 +301,11 @@ class NCMainCommon: NSObject {
                     cell.status.image = UIImage.init(named: "encrypted")
                 }
                 
+                // Available offline
+                if tableLocalFile != nil && tableLocalFile!.onDevice {
+                    cell.favorite.image = UIImage.init(named: "flagOnDevice")
+                }
+                
                 // Share
                 if (isShare) {
                     cell.shared.image =  CCGraphics.changeThemingColorImage(UIImage.init(named: "share"), multiplier: 2, color: NCBrandColor.sharedInstance.optionItem)