瀏覽代碼

added visual feedback on cell taps

nayooti 5 年之前
父節點
當前提交
8ada296a90
共有 2 個文件被更改,包括 8 次插入0 次删除
  1. 1 0
      deltachat-ios/Controller/GalleryViewController.swift
  2. 7 0
      deltachat-ios/View/Cell/GalleryCell.swift

+ 1 - 0
deltachat-ios/Controller/GalleryViewController.swift

@@ -33,6 +33,7 @@ class GalleryViewController: UIViewController {
         )
         collection.contentInset = UIEdgeInsets(top: 0, left: gridInsets, bottom: 0, right: gridInsets)
         collection.backgroundColor = .white
+        collection.delaysContentTouches = false
         return collection
     }()
 

+ 7 - 0
deltachat-ios/View/Cell/GalleryCell.swift

@@ -35,4 +35,11 @@ class GalleryCell: UICollectionViewCell {
         }
         imageView.image = image
     }
+
+    override var isSelected: Bool {
+        willSet {
+            contentView.backgroundColor = newValue ? DcColors.primary : .white
+            imageView.alpha = newValue ? 0.75 : 1.0
+        }
+    }
 }