marinofaggiana пре 6 година
родитељ
комит
a5f4885fe0
1 измењених фајлова са 10 додато и 6 уклоњено
  1. 10 6
      iOSClient/Trash/NCTrash.swift

+ 10 - 6
iOSClient/Trash/NCTrash.swift

@@ -31,7 +31,6 @@ class NCTrash: UIViewController, UIGestureRecognizerDelegate, NCTrashListCellDel
     var path = ""
     var titleCurrentFolder = NSLocalizedString("_trash_view_", comment: "")
     var scrollToFileID = ""
-    var scrollToIndexPath: IndexPath?
     
     private let appDelegate = UIApplication.shared.delegate as! AppDelegate
     
@@ -653,17 +652,22 @@ extension NCTrash {
             if self.scrollToFileID != "" {
                 for item in 0...self.datasource.count-1 {
                     if self.datasource[item].fileID.contains(self.scrollToFileID) {
-                        self.scrollToIndexPath = IndexPath(item: item, section: 0)
-                        self.collectionView.scrollToItem(at: self.scrollToIndexPath!, at: .top, animated: true)
-                        self.collectionView.selectItem(at: self.scrollToIndexPath, animated: true, scrollPosition: UICollectionView.ScrollPosition(rawValue: 1))
+                        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) {
-                            self.collectionView.deselectItem(at: self.scrollToIndexPath!, animated: true)
+                            if let cell = self.collectionView.cellForItem(at: indexPath) as? NCTrashListCell {
+                                cell.backgroundColor = NCBrandColor.sharedInstance.brandElement
+                                UIView.animate(withDuration: 1.0, animations: {
+                                    cell.backgroundColor = .white
+                                })
+                            }
                         }
                     }
                 }
                 self.scrollToFileID = ""
             }
-        }
+        }        
     }
     
     @objc func loadListingTrash() {