From ed12a74ccfe4902694d9cbb3926330a6453a33d3 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Mon, 10 Dec 2018 11:57:14 -0700 Subject: [PATCH 1/2] album picker design tweaks --- .../ViewControllers/PhotoLibrary/ImagePickerController.swift | 2 +- .../PhotoLibrary/PhotoCollectionPickerController.swift | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift b/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift index 4ab7e5203..615c6acaf 100644 --- a/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift +++ b/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift @@ -422,7 +422,7 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat self.updateSelectButton() // *slightly* more than `pi` to ensure the chevron animates counter-clockwise - let chevronRotationAngle = CGFloat.pi.nextUp + let chevronRotationAngle = CGFloat.pi + 0.001 self.titleIconView.transform = CGAffineTransform(rotationAngle: chevronRotationAngle) }.retainUntilComplete() } diff --git a/Signal/src/ViewControllers/PhotoLibrary/PhotoCollectionPickerController.swift b/Signal/src/ViewControllers/PhotoLibrary/PhotoCollectionPickerController.swift index 60977e1f7..c0b79e506 100644 --- a/Signal/src/ViewControllers/PhotoLibrary/PhotoCollectionPickerController.swift +++ b/Signal/src/ViewControllers/PhotoLibrary/PhotoCollectionPickerController.swift @@ -93,6 +93,8 @@ class PhotoCollectionPickerController: OWSTableViewController, PhotoLibraryDeleg textStack.spacing = 2 let imageView = UIImageView() + imageView.contentMode = .scaleAspectFill + imageView.clipsToBounds = true let kImageSize = 80 imageView.autoSetDimensions(to: CGSize(width: kImageSize, height: kImageSize)) From 1ab0daeb9be90d2cc956921c6e62c58dd9f90911 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Mon, 10 Dec 2018 12:00:54 -0700 Subject: [PATCH 2/2] just a bit faster --- .../ViewControllers/PhotoLibrary/ImagePickerController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift b/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift index 615c6acaf..c9cc525d6 100644 --- a/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift +++ b/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift @@ -416,7 +416,7 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat // Initially position offscreen, we'll animate it in. collectionPickerView.frame = collectionPickerView.frame.offsetBy(dx: 0, dy: collectionPickerView.frame.height) - UIView.animate(.promise, duration: 0.3, delay: 0, options: .curveEaseInOut) { + UIView.animate(.promise, duration: 0.25, delay: 0, options: .curveEaseInOut) { collectionPickerView.superview?.layoutIfNeeded() self.updateSelectButton() @@ -435,7 +435,7 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat } self.collectionPickerController = nil - UIView.animate(.promise, duration: 0.3, delay: 0, options: .curveEaseInOut) { + UIView.animate(.promise, duration: 0.25, delay: 0, options: .curveEaseInOut) { collectionPickerController.view.frame = self.view.frame.offsetBy(dx: 0, dy: self.view.frame.height) self.updateSelectButton()