marinofaggiana 6 tahun lalu
induk
melakukan
9d9038faae
2 mengubah file dengan 18 tambahan dan 10 penghapusan
  1. 11 4
      iOSClient/Main/CCMain.m
  2. 7 6
      iOSClient/Trash/NCTrash.swift

+ 11 - 4
iOSClient/Main/CCMain.m

@@ -3756,7 +3756,7 @@
     [self.tableView reloadEmptyDataSet];
     
     // scrollToFileNamePath
-    if (self.scrollToFileNamePath != nil && withScrollToFileName) {
+    if (self.scrollToFileNamePath != nil) {
         for (NSString *key in sectionDataSource.allRecordsDataSource) {
             tableMetadata *metadata = [sectionDataSource.allRecordsDataSource objectForKey:key];
             NSString *metadataFileNamePath = [NSString stringWithFormat:@"%@/%@", metadata.serverUrl, metadata.fileName];
@@ -3765,15 +3765,22 @@
                     if ([key isEqualToString:metadata.fileID]) {
                         NSIndexPath *indexPath = [sectionDataSource.fileIDIndexPath objectForKey:key];
                         [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:NO];
-                        [self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
                         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
-                            [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
+                            CCCellMain *cell = [self.tableView cellForRowAtIndexPath:indexPath];
+                            if (cell) {
+                                cell.layer.borderWidth = 1;
+                                cell.layer.borderColor = [[NCBrandColor sharedInstance] brand].CGColor;
+                                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
+                                    cell.layer.borderWidth = 0;
+                                    cell.layer.borderColor = [UIColor clearColor].CGColor;
+                                });
+                            }
                         });
                     }
                 }
+                self.scrollToFileNamePath = nil;
             }
         }
-        self.scrollToFileNamePath = nil;
     }
 }
 

+ 7 - 6
iOSClient/Trash/NCTrash.swift

@@ -654,18 +654,19 @@ extension NCTrash {
                     if self.datasource[item].fileID.contains(self.scrollToFileID) {
                         let indexPath = IndexPath(item: item, section: 0)
                         self.collectionView.scrollToItem(at: indexPath, at: .top, animated: true)
-                        self.collectionView.selectItem(at: indexPath, animated: true, scrollPosition: UICollectionView.ScrollPosition(rawValue: 1))
                         DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
                             if let cell = self.collectionView.cellForItem(at: indexPath) as? NCTrashListCell {
-                                cell.backgroundColor = NCBrandColor.sharedInstance.brandElement
-                                UIView.animate(withDuration: 1.0, animations: {
-                                    cell.backgroundColor = .white
-                                })
+                                cell.layer.borderWidth = 1
+                                cell.layer.borderColor = NCBrandColor.sharedInstance.brand.cgColor
+                                DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
+                                    cell.layer.borderWidth = 0
+                                    cell.layer.borderColor = UIColor.clear.cgColor
+                                }
                             }
                         }
+                        self.scrollToFileID = ""
                     }
                 }
-                self.scrollToFileID = ""
             }
         }        
     }