ソースを参照

fix animation

marinofaggiana 6 年 前
コミット
9a2e5c4e0a
1 ファイル変更8 行追加0 行削除
  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 = ""