Преглед на файлове

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
+        }
+    }
 }