Browse Source

fix animation

marinofaggiana 6 years ago
parent
commit
9a2e5c4e0a
1 changed files with 8 additions and 0 deletions
  1. 8 0
      iOSClient/Trash/NCTrash.swift

+ 8 - 0
iOSClient/Trash/NCTrash.swift

@@ -683,6 +683,14 @@ extension NCTrash {
                     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)
+                        DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
+                            if let cell = self.collectionView.cellForItem(at: self.scrollToIndexPath!) as? NCTrashListCell {
+                                cell.backgroundColor = NCBrandColor.sharedInstance.brandElement
+                                UIView.animate(withDuration: 0.5, animations: {
+                                    cell.backgroundColor = .white
+                                })
+                            }
+                        }
                     }
                 }
                 self.scrollToFileID = ""