From 6e492927d1a5742dcd98374febaa7bee349db4f2 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Mon, 11 Mar 2019 16:52:32 -0400 Subject: [PATCH 01/15] Prevent users from selecting additional images while processing images in the image picker. --- .../PhotoLibrary/ImagePickerController.swift | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift b/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift index c692952fc..54ac6aa07 100644 --- a/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift +++ b/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift @@ -380,19 +380,32 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat } func complete(withAssets assets: [PHAsset]) { - let attachmentPromises: [Promise] = assets.map({ - return photoCollectionContents.outgoingAttachment(for: $0) - }) - - firstly { - when(fulfilled: attachmentPromises) - }.map { attachments in - Logger.debug("built all attachments") - self.didComplete(withAttachments: attachments) - }.catch { error in - Logger.error("failed to prepare attachments. error: \(error)") - OWSAlerts.showAlert(title: NSLocalizedString("IMAGE_PICKER_FAILED_TO_PROCESS_ATTACHMENTS", comment: "alert title")) - }.retainUntilComplete() + + ModalActivityIndicatorViewController.present(fromViewController: self, + canCancel: false) { (modal) in + let attachmentPromises: [Promise] = assets.map({ + return self.photoCollectionContents.outgoingAttachment(for: $0) + }) + + firstly { + when(fulfilled: attachmentPromises) + }.map { attachments in + Logger.debug("built all attachments") + + DispatchQueue.main.async { + modal.dismiss(completion: { + self.didComplete(withAttachments: attachments) + }) + } + }.catch { error in + Logger.error("failed to prepare attachments. error: \(error)") + DispatchQueue.main.async { + modal.dismiss(completion: { + OWSAlerts.showAlert(title: NSLocalizedString("IMAGE_PICKER_FAILED_TO_PROCESS_ATTACHMENTS", comment: "alert title")) + }) + } + }.retainUntilComplete() + } } private func didComplete(withAttachments attachments: [SignalAttachment]) { From 7a67a7b6b565af47536b21ad2c0979ff2999d25a Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Mon, 11 Mar 2019 16:52:58 -0400 Subject: [PATCH 02/15] Hide the status bar in the image picker / attachment approval. --- .../ConversationView/ConversationViewController.m | 4 +++- .../AttachmentApprovalViewController.swift | 11 +++++------ .../ViewControllers/OWSNavigationController.h | 7 ++++++- .../ViewControllers/OWSNavigationController.m | 8 ++++++++ 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 9059a8888..ad2ecdf66 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -2836,7 +2836,9 @@ typedef enum : NSUInteger { OWSImagePickerGridController *picker = [OWSImagePickerGridController new]; picker.delegate = self; - pickerModal = [[OWSNavigationController alloc] initWithRootViewController:picker]; + OWSNavigationController *modal = [[OWSNavigationController alloc] initWithRootViewController:picker]; + modal.ows_prefersStatusBarHidden = @(YES); + pickerModal = modal; } else { UIImagePickerController *picker = [OWSImagePickerController new]; picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; diff --git a/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift b/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift index 10fc300cb..66e9a6973 100644 --- a/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift +++ b/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift @@ -169,6 +169,7 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC let vc = AttachmentApprovalViewController(mode: .modal, attachments: attachments) vc.approvalDelegate = approvalDelegate let navController = OWSNavigationController(rootViewController: vc) + navController.ows_prefersStatusBarHidden = true guard let navigationBar = navController.navigationBar as? OWSNavigationBar else { owsFailDebug("navigationBar was nil or unexpected class") @@ -198,6 +199,10 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC // MARK: - View Lifecycle + public override var prefersStatusBarHidden: Bool { + return true + } + override public func viewDidLoad() { super.viewDidLoad() @@ -229,8 +234,6 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC Logger.debug("") super.viewWillAppear(animated) - CurrentAppContext().setStatusBarHidden(true, animated: animated) - guard let navigationBar = navigationController?.navigationBar as? OWSNavigationBar else { owsFailDebug("navigationBar was nil or unexpected class") return @@ -251,10 +254,6 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC override public func viewWillDisappear(_ animated: Bool) { Logger.debug("") super.viewWillDisappear(animated) - - // Since this VC is being dismissed, the "show status bar" animation would feel like - // it's occuring on the presenting view controller - it's better not to animate at all. - CurrentAppContext().setStatusBarHidden(false, animated: false) } override public var inputAccessoryView: UIView? { diff --git a/SignalMessaging/ViewControllers/OWSNavigationController.h b/SignalMessaging/ViewControllers/OWSNavigationController.h index 533a5b4d0..3cc656c8a 100644 --- a/SignalMessaging/ViewControllers/OWSNavigationController.h +++ b/SignalMessaging/ViewControllers/OWSNavigationController.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import @@ -23,6 +23,11 @@ NS_ASSUME_NONNULL_BEGIN // unsaved changes. @interface OWSNavigationController : UINavigationController +// If set, this property lets us override prefersStatusBarHidden behavior. +// This is useful for supressing the status bar while a modal is presented, +// regardless of which view is currently visible. +@property (nonatomic, nullable) NSNumber *ows_prefersStatusBarHidden; + @end NS_ASSUME_NONNULL_END diff --git a/SignalMessaging/ViewControllers/OWSNavigationController.m b/SignalMessaging/ViewControllers/OWSNavigationController.m index 64fa3604b..b2e40a3a5 100644 --- a/SignalMessaging/ViewControllers/OWSNavigationController.m +++ b/SignalMessaging/ViewControllers/OWSNavigationController.m @@ -69,6 +69,14 @@ NS_ASSUME_NONNULL_BEGIN self.interactivePopGestureRecognizer.delegate = self; } +- (BOOL)prefersStatusBarHidden +{ + if (self.ows_prefersStatusBarHidden) { + return self.ows_prefersStatusBarHidden.boolValue; + } + return [super prefersStatusBarHidden]; +} + #pragma mark - UINavigationBarDelegate - (void)setupNavbar From e2d54d082efdb19c2e544627437ae78ea1f44587 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Mon, 11 Mar 2019 17:02:09 -0400 Subject: [PATCH 03/15] Modify attachment approval back button to not have "back" text. --- .../ViewControllers/AttachmentApprovalViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift b/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift index 66e9a6973..0ea34be8e 100644 --- a/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift +++ b/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift @@ -294,7 +294,8 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC cancelButton.tintColor = .white self.navigationItem.leftBarButtonItem = cancelButton } else { - self.navigationItem.leftBarButtonItem = nil + // Note: using a custom leftBarButtonItem breaks the interactive pop gesture. + self.navigationItem.leftBarButtonItem = self.createOWSBackButton() } } From 6f44167e5cd1df5fd63b9c9b19444c4099f13389 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Mon, 11 Mar 2019 17:11:00 -0400 Subject: [PATCH 04/15] Tweak navigation bar button spacing. --- .../Views/ImageEditor/OWSViewController+ImageEditor.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift b/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift index a7f50cf3e..4e91faa35 100644 --- a/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift +++ b/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift @@ -29,7 +29,7 @@ public extension UIViewController { return } - let spacing: CGFloat = 8 + let spacing: CGFloat = 16 let stackView = UIStackView(arrangedSubviews: navigationBarItems) stackView.axis = .horizontal stackView.spacing = spacing From eff929dd1a0f69a615cab147a21c41adc403fe90 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 12 Mar 2019 10:41:00 -0400 Subject: [PATCH 05/15] Add border and shadow to image editor's palette view. --- .../Views/ImageEditor/ImageEditorPaletteView.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorPaletteView.swift b/SignalMessaging/Views/ImageEditor/ImageEditorPaletteView.swift index 2e7689604..0ba7170a6 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorPaletteView.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorPaletteView.swift @@ -100,7 +100,11 @@ public class ImageEditorPaletteView: UIView { // We use an invisible margin to expand the hot area of this control. let margin: CGFloat = 20 imageView.autoPinEdgesToSuperviewEdges(with: UIEdgeInsets(top: margin, left: margin, bottom: margin, right: margin)) - + imageView.layer.borderColor = UIColor.white.cgColor + imageView.layer.borderWidth = CGHairlineWidth() + imageView.layer.shadowColor = UIColor.black.cgColor + imageView.layer.shadowOpacity = 2.0 + imageView.layer.shadowOpacity = 0.33 selectionWrapper.layoutCallback = { [weak self] (view) in guard let strongSelf = self else { return From e9a4ae7addd157157b4ef26731b4f14aabf32a55 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 12 Mar 2019 11:02:29 -0400 Subject: [PATCH 06/15] Fix image editor navigation bar button shadows. --- .../Views/ImageEditor/OWSViewController+ImageEditor.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift b/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift index 4e91faa35..9b233fd3f 100644 --- a/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift +++ b/SignalMessaging/Views/ImageEditor/OWSViewController+ImageEditor.swift @@ -15,6 +15,7 @@ public extension NSObject { button.layer.shadowColor = UIColor.black.cgColor button.layer.shadowRadius = 2 button.layer.shadowOpacity = 0.66 + button.layer.shadowOffset = .zero return button } } From 0a6ad365d4c9977b38903c82f2b1d3a501d349a3 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 12 Mar 2019 11:03:26 -0400 Subject: [PATCH 07/15] Refine the image editor crop tool's gestures. --- .../ImageEditor/ImageEditorCropViewController.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift b/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift index e3e2b0b0d..9113d8f20 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift @@ -368,14 +368,22 @@ class ImageEditorCropViewController: OWSViewController { let pinchGestureRecognizer = ImageEditorPinchGestureRecognizer(target: self, action: #selector(handlePinchGesture(_:))) pinchGestureRecognizer.referenceView = self.clipView + // Use this VC as a delegate to ensure that pinches only + // receive touches that start inside of the cropped image bounds. pinchGestureRecognizer.delegate = self view.addGestureRecognizer(pinchGestureRecognizer) let panGestureRecognizer = ImageEditorPanGestureRecognizer(target: self, action: #selector(handlePanGesture(_:))) panGestureRecognizer.maximumNumberOfTouches = 1 panGestureRecognizer.referenceView = self.clipView - panGestureRecognizer.delegate = self + // _DO NOT_ use this VC as a delegate to filter touches; + // pan gestures can start outside the cropped image bounds. + // Otherwise the edges of the crop rect are difficult to + // "grab". view.addGestureRecognizer(panGestureRecognizer) + + // De-conflict the gestures; the pan gesture has priority. + panGestureRecognizer.shouldBeRequiredToFail(by: pinchGestureRecognizer) } override public var canBecomeFirstResponder: Bool { From 5aaa66792735b3a6c598cac0d7e98a457ab84cea Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 12 Mar 2019 11:12:38 -0400 Subject: [PATCH 08/15] Modify the image editor's crop tool to render the cropped and uncropped content. --- .../ImageEditorCropViewController.swift | 49 +++++++++++++------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift b/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift index 9113d8f20..2afb844b6 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift @@ -23,11 +23,13 @@ class ImageEditorCropViewController: OWSViewController { private var transform: ImageEditorTransform - public let contentView = OWSLayerView() - public let clipView = OWSLayerView() - private var imageLayer = CALayer() + public let croppedContentView = OWSLayerView() + public let uncroppedContentView = UIView() + + private var croppedImageLayer = CALayer() + private var uncroppedImageLayer = CALayer() private enum CropRegion { // The sides of the crop region. @@ -121,19 +123,32 @@ class ImageEditorCropViewController: OWSViewController { } wrapperView.addSubview(clipView) - imageLayer.contents = previewImage.cgImage - imageLayer.contentsScale = previewImage.scale - contentView.backgroundColor = .clear - contentView.isOpaque = false - contentView.layer.addSublayer(imageLayer) - contentView.layoutCallback = { [weak self] (_) in + croppedImageLayer.contents = previewImage.cgImage + croppedImageLayer.contentsScale = previewImage.scale + croppedContentView.backgroundColor = .clear + croppedContentView.isOpaque = false + croppedContentView.layer.addSublayer(croppedImageLayer) + croppedContentView.layoutCallback = { [weak self] (_) in guard let strongSelf = self else { return } strongSelf.updateContent() } - clipView.addSubview(contentView) - contentView.autoPinEdgesToSuperviewEdges() + clipView.addSubview(croppedContentView) + croppedContentView.autoPinEdgesToSuperviewEdges() + + uncroppedImageLayer.contents = previewImage.cgImage + uncroppedImageLayer.contentsScale = previewImage.scale + // The "uncropped" view/layer are used to display the + // content that has been cropped out. Its content + // should be semi-transparent to distinguish it from + // the content within the crop bounds. + uncroppedImageLayer.opacity = 0.5 + uncroppedContentView.backgroundColor = .clear + uncroppedContentView.isOpaque = false + uncroppedContentView.layer.addSublayer(uncroppedImageLayer) + wrapperView.addSubview(uncroppedContentView) + uncroppedContentView.autoPin(toEdgesOf: croppedContentView) // MARK: - Footer @@ -329,7 +344,7 @@ class ImageEditorCropViewController: OWSViewController { Logger.verbose("") - let viewSize = contentView.bounds.size + let viewSize = croppedContentView.bounds.size guard viewSize.width > 0, viewSize.height > 0 else { return @@ -354,13 +369,15 @@ class ImageEditorCropViewController: OWSViewController { } private func applyTransform() { - let viewSize = contentView.bounds.size - contentView.layer.setAffineTransform(transform.affineTransform(viewSize: viewSize)) + let viewSize = croppedContentView.bounds.size + croppedContentView.layer.setAffineTransform(transform.affineTransform(viewSize: viewSize)) + uncroppedContentView.layer.setAffineTransform(transform.affineTransform(viewSize: viewSize)) } private func updateImageLayer() { - let viewSize = contentView.bounds.size - ImageEditorCanvasView.updateImageLayer(imageLayer: imageLayer, viewSize: viewSize, imageSize: model.srcImageSizePixels, transform: transform) + let viewSize = croppedContentView.bounds.size + ImageEditorCanvasView.updateImageLayer(imageLayer: croppedImageLayer, viewSize: viewSize, imageSize: model.srcImageSizePixels, transform: transform) + ImageEditorCanvasView.updateImageLayer(imageLayer: uncroppedImageLayer, viewSize: viewSize, imageSize: model.srcImageSizePixels, transform: transform) } private func configureGestures() { From cea361705ea30e00a78efeb04fb568f68db6349a Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 12 Mar 2019 11:18:05 -0400 Subject: [PATCH 09/15] Update asset for "add more images to album" button. --- .../album_add_more.imageset/Contents.json | 6 +++--- .../album_add_more.imageset/add-photo-24@1x.png | Bin 262 -> 0 bytes .../album_add_more.imageset/add-photo-24@2x.png | Bin 392 -> 0 bytes .../album_add_more.imageset/add-photo-24@3x.png | Bin 549 -> 0 bytes .../create-album-outline-32@1x.png | Bin 0 -> 477 bytes .../create-album-outline-32@2x.png | Bin 0 -> 813 bytes .../create-album-outline-32@3x.png | Bin 0 -> 1208 bytes 7 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 Signal/Images.xcassets/album_add_more.imageset/add-photo-24@1x.png delete mode 100644 Signal/Images.xcassets/album_add_more.imageset/add-photo-24@2x.png delete mode 100644 Signal/Images.xcassets/album_add_more.imageset/add-photo-24@3x.png create mode 100644 Signal/Images.xcassets/album_add_more.imageset/create-album-outline-32@1x.png create mode 100644 Signal/Images.xcassets/album_add_more.imageset/create-album-outline-32@2x.png create mode 100644 Signal/Images.xcassets/album_add_more.imageset/create-album-outline-32@3x.png diff --git a/Signal/Images.xcassets/album_add_more.imageset/Contents.json b/Signal/Images.xcassets/album_add_more.imageset/Contents.json index 3b4a85bc9..ae32da7a5 100644 --- a/Signal/Images.xcassets/album_add_more.imageset/Contents.json +++ b/Signal/Images.xcassets/album_add_more.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "add-photo-24@1x.png", + "filename" : "create-album-outline-32@1x.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "add-photo-24@2x.png", + "filename" : "create-album-outline-32@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "add-photo-24@3x.png", + "filename" : "create-album-outline-32@3x.png", "scale" : "3x" } ], diff --git a/Signal/Images.xcassets/album_add_more.imageset/add-photo-24@1x.png b/Signal/Images.xcassets/album_add_more.imageset/add-photo-24@1x.png deleted file mode 100644 index 1f653a075979628e27a0c9018bc16d772945f26f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GGLLkg|>2BR0px_Qq z7sn8f&a0t}d@Tw*w|n@%W`163Jmay`HD1=IezSF$qP?!2JFv=2*^oE&|54U26Fn|{ zYMXE*{Mb9j;$Iqv-}Zi};8RU{#>!`{5_EgkM87jXg|0CB&vA%fQkHolS(vXdzax87 z`W4Z`>ctuXm7m&0@8R53ksKw$1n{_}|EN_1qbLZd%*?5e0v0t(T zSRws4_Lm2S5TIo)O=s@{4B!IPi7qraQ5ScOwQkH$YF`^g#2Wy-j1Dl8g9+EQC!7T$ z78R(ekc}r;6OhZtT?i5T*ht4okTtM2c>uT%+i|)dB&artjfUT@Y*}dofS$43o{LT5 z#eOEfD4$INgycmLvv|_awQ2$~$&)07_^gP-1X!=oi*=xd3SI0%Rx9*k9S9-3$w6Z* z3eYT2rHBI3B4rs?K#k<%y<7T(xdtMjm60DIHY%~#g*cl&;yPpoTEhisv+I3;Be#~M z{;g}nXJC#rlC?e>q%-g&y$z84KTylRkGhWAs5b6GrPO+(^IJ%p|5*dlGmJJRGhneo mPdWLYdTm^QHZDLF0Qdk3yfx@OB4IHA0000y95KI&fr0V5 zr;B4q#hkZu8gmaT2)Mpq#Wz9FD#$#;Y_+?m*-JGSzsFh|E$wC`CI9eunrLw7;nN(x zM=o=VopSD-QGUY5%BaEN;K;zm6d=&h#30flA$)XY#|cjtz2ws7RGI59EB6?t>a7U1 z4Bokft12>UMb_une9!0TX)*7KZV$3vHFFOCJo8KjkSQBF6+&(GwfLP19amX(ocR9u zYsHyQ3--@BI9*spJyPkg4!>m0Td(PJ3PpvVOx)}>sbfy<*Us82su~LFo|l5{BPWJW zUBF=(ILYQO%k6eA(yeVco89QBfc8w3l&bQH%-RP8IJsx@!ib5!m2C6ErpD`-)gF>z18qFXsYU) z!x=2_^iNXSCBrFvzjgHuU&o}e2y%5b0X@&MK*8Z!nLFP~<20Y&LdLSnz>sOUtG98+ z>4RSPwx!59UbnsHa`p^sZO|p{ll#S2C)RFxy0c<38zks}x)0=aCh?foY(2{X4NkC$ zI@exZPFwZs;hf(SrwU&AmG$51@Rp00i_>zopr03j#U>;M1& diff --git a/Signal/Images.xcassets/album_add_more.imageset/create-album-outline-32@1x.png b/Signal/Images.xcassets/album_add_more.imageset/create-album-outline-32@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..d23c007d13f7c74ecb487527c2e2ffa568ca4936 GIT binary patch literal 477 zcmV<30V4j1P)ff2ev!v^UF zjF3*Co;W#YED;<+6MB7jCUN}r{3OeQm>F~8Vb;~}fdIq=X#ubSaFFH^r3J79Pqy1jxp66hFrd_W1)v^j zie7V^n1G0+vS;Rsh-C54NJd}6Jgfjby5>j}ke^!L!_Hql=?0pkPz8)R`Uo6-!JBXd z5!rbgf4dY1#>noWQB!pI`;kzbRh(Cyc6tJ1(Geh`a#jM&d@!vOU@>$F$JVRxB%+fB zX0FWyDK5l;+BwT!sCA1oHUzgSd>gC)fM-X6cK~mC&T}^1DKnTrDr+QrlO=hAy9`8y z`7$AaZ^>kcXl;5 zT?XUja#s*=Ga{3g2M|%Ak!z{W*%xHw9_hQx@^V6lb!-kd+}<=Ro&*2<&nbW(iTSP3 Tbda`p00000NkvXXu0mjfzh=!U literal 0 HcmV?d00001 diff --git a/Signal/Images.xcassets/album_add_more.imageset/create-album-outline-32@2x.png b/Signal/Images.xcassets/album_add_more.imageset/create-album-outline-32@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..9ccabb7c69fce53efb9b3b2cb0d4a6d58bbf66a5 GIT binary patch literal 813 zcmV+|1JeA7P)h5!$HpY63(cTNF-&KQ-utRcXi9CHn| zTZlozkdpxa>6=fUhvjb$hn*3lbIR^g5|lzXwiSktMtR4MmpCyduMSEf96X2yH%9qr zbbNQKLu?}?XW6sa9ueJ>|L)a)XVOOQeCgHU$=QvF@zud%g`coFxo~H)%r(BU+PH_+ zK`9al@Z-J+=RMn#SBEJtL%q0uC!&L@u`r0ptzaL*ir0`u*S-xF=e)pHT(49qV+sM! z;yOIJEDt$xKZmTjb_C2l+h2kt+p0ehX#^W74lQ r?axuAsSJ$(rKt>!fC6k-4gl~E>TFL#pFtBG00000NkvXXu0mjfl8j{` literal 0 HcmV?d00001 diff --git a/Signal/Images.xcassets/album_add_more.imageset/create-album-outline-32@3x.png b/Signal/Images.xcassets/album_add_more.imageset/create-album-outline-32@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..b13aa24b3e1399da20c58955939905ac51468983 GIT binary patch literal 1208 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGooCO|{#S9FJ<{->y95KI&fq^B< z)5S5QV$R#S7YlD2@U%6?-Ji@miT4%nth@=luY3ghC*(}Z7W zfB6YIOjOczT=wzq!`4Z;LH3+NTUZnY8y6lI-~DaZ42DyfsAlcY&m9%a4DPQ#&7HgE z{OW*aU4}OuFU+ltMD>L93>kK?G_W(=*u6gc2;V;6=}WJxr!5u#zilJ;ee>(vq*uOu z#l&!6a=^o|T;14ascBm!+dK3bK1`P7`24K>YfwSn=i4WC-4VRVt*yJX=)C=}b5pzH?AqKr`Wq23F^e1`QmI4|)XdLG>&*!A2tOd;~XU!Gr1_irz?T2Ef){YTGDl4@l6hn zIpR^P4aoL*CE9#;4=Y(Ftye+pfUp@MM zOM2F8HgOG8mK$8pJ#LGHHcxBqQs`}IE?Jji`hQZ)#!39sub8-O`REuuom;-bZKY;| z$iuuy&)FV<8?PuzPX4Fq?@}FhLoLXCvX#o=cU>zSG}OEfvIHChqh-q&{{H=AUgmcD z%k9};{vVs7oZu;)T|D9Hy|fqsr98ojR%*Ju;_YV{(c|BR^@IOj3E_!GOq)A zg+;pV+@3-QmaA637me3_=~=P;v!~0Ajguu7CO>0%nfamG#pcPfc#lk{4^_`dSq@f z3NFuWxf1()!X}+5nns$-&9pVv^n^@Qe|e{kCBo;NMf;R3Tcp>Rw&q{odqGVzW9r0^ znF$t?)?Ycf|AFGA&zh<$e=dJNk&9bfEj8-Bn(1Ahr*q?exUQdPSw6`;>-R!Sv-*;? zcP>`j3weKE^sMq?{}QjI_k>Pq-CmWN>YvUkykqgghqsz!)#~dV7ILiJ=eqdRYd-av z%uX)%l#8e7|CtlY(44$|sYWsrCdy!9_|MQZLF Date: Tue, 12 Mar 2019 11:24:19 -0400 Subject: [PATCH 10/15] Remove cancel button from attachment caption view. --- .../AttachmentCaptionViewController.swift | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/SignalMessaging/ViewControllers/AttachmentCaptionViewController.swift b/SignalMessaging/ViewControllers/AttachmentCaptionViewController.swift index c54a8e31c..7b57106b6 100644 --- a/SignalMessaging/ViewControllers/AttachmentCaptionViewController.swift +++ b/SignalMessaging/ViewControllers/AttachmentCaptionViewController.swift @@ -75,11 +75,6 @@ class AttachmentCaptionViewController: OWSViewController { configureTextView() - let cancelButton = UIBarButtonItem(barButtonSystemItem: .cancel, - target: self, - action: #selector(didTapCancel)) - cancelButton.tintColor = .white - navigationItem.leftBarButtonItem = cancelButton let doneIcon = UIImage(named: "image_editor_checkmark_full")?.withRenderingMode(.alwaysTemplate) let doneButton = UIBarButtonItem(image: doneIcon, style: .plain, target: self, @@ -96,7 +91,6 @@ class AttachmentCaptionViewController: OWSViewController { stackView.axis = .vertical stackView.spacing = 20 stackView.alignment = .fill - stackView.addBackgroundView(withBackgroundColor: UIColor(white: 0, alpha: 0.5)) stackView.layoutMargins = UIEdgeInsets(top: 16, left: 20, bottom: 16, right: 20) stackView.isLayoutMarginsRelativeArrangement = true self.view.addSubview(stackView) @@ -104,6 +98,15 @@ class AttachmentCaptionViewController: OWSViewController { stackView.autoPinEdge(toSuperviewEdge: .trailing) self.autoPinView(toBottomOfViewControllerOrKeyboard: stackView, avoidNotch: true) + let backgroundView = UIView() + backgroundView.backgroundColor = UIColor(white: 0, alpha: 0.5) + view.addSubview(backgroundView) + view.sendSubview(toBack: backgroundView) + backgroundView.autoPinEdge(toSuperviewEdge: .leading) + backgroundView.autoPinEdge(toSuperviewEdge: .trailing) + backgroundView.autoPinEdge(toSuperviewEdge: .bottom) + backgroundView.autoPinEdge(.top, to: .top, of: stackView) + let minTextHeight: CGFloat = textView.font?.lineHeight ?? 0 textViewHeightConstraint = textView.autoSetDimension(.height, toSize: minTextHeight) From c77835926d623030ab82cee2997dcac87e4529fb Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 12 Mar 2019 11:41:04 -0400 Subject: [PATCH 11/15] Tap to create new text item. --- SignalMessaging/Views/ImageEditor/ImageEditorView.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorView.swift b/SignalMessaging/Views/ImageEditor/ImageEditorView.swift index c0e490931..5bba4bc0f 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorView.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorView.swift @@ -138,6 +138,12 @@ public class ImageEditorView: UIView { @objc func didTapNewText(sender: UIButton) { Logger.verbose("") + createNewTextItem() + } + + private func createNewTextItem() { + Logger.verbose("") + let viewSize = canvasView.gestureReferenceView.bounds.size let imageSize = model.srcImageSizePixels let imageFrame = ImageEditorCanvasView.imageFrame(forViewSize: viewSize, imageSize: imageSize, @@ -178,6 +184,8 @@ public class ImageEditorView: UIView { let location = gestureRecognizer.location(in: canvasView.gestureReferenceView) guard let textLayer = self.textLayer(forLocation: location) else { + // If there is no text item under the "tap", start a new one. + createNewTextItem() return } From 9e636b0fc91797edd42390d5d1a91755f8bfcdd9 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 12 Mar 2019 11:46:12 -0400 Subject: [PATCH 12/15] Hide controls during stroke. --- .../ImageEditorBrushViewController.swift | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorBrushViewController.swift b/SignalMessaging/Views/ImageEditor/ImageEditorBrushViewController.swift index 63a7590a7..af56c8db1 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorBrushViewController.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorBrushViewController.swift @@ -84,11 +84,18 @@ public class ImageEditorBrushViewController: OWSViewController { self.view.layoutSubviews() } - public func updateNavigationBar() { + private func updateNavigationBar() { + // Hide controls during stroke. + let hasStroke = currentStroke != nil + guard !hasStroke else { + updateNavigationBar(navigationBarItems: []) + return + } + let undoButton = navigationBarButton(imageName: "image_editor_undo", selector: #selector(didTapUndo(sender:))) let doneButton = navigationBarButton(imageName: "image_editor_checkmark_full", - selector: #selector(didTapDone(sender:))) + selector: #selector(didTapDone(sender:))) // Prevent users from undo any changes made before entering the view. let canUndo = model.canUndo() && firstUndoOperationId != model.currentUndoOperationId() @@ -101,6 +108,12 @@ public class ImageEditorBrushViewController: OWSViewController { updateNavigationBar(navigationBarItems: navigationBarItems) } + private func updateControls() { + // Hide controls during stroke. + let hasStroke = currentStroke != nil + paletteView.isHidden = hasStroke + } + // MARK: - Actions @objc func didTapUndo(sender: UIButton) { @@ -129,7 +142,12 @@ public class ImageEditorBrushViewController: OWSViewController { // MARK: - Brush // These properties are non-empty while drawing a stroke. - private var currentStroke: ImageEditorStrokeItem? + private var currentStroke: ImageEditorStrokeItem? { + didSet { + updateControls() + updateNavigationBar() + } + } private var currentStrokeSamples = [ImageEditorStrokeItem.StrokeSample]() @objc From e63b1169a3eecbb912373e3be09ce49dcb155635 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 12 Mar 2019 12:19:09 -0400 Subject: [PATCH 13/15] Hide controls while moving text items. --- .../AttachmentApprovalViewController.swift | 57 +++++++++++++++++-- .../Views/ImageEditor/ImageEditorView.swift | 34 ++++++++--- 2 files changed, 78 insertions(+), 13 deletions(-) diff --git a/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift b/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift index 0ea34be8e..784828584 100644 --- a/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift +++ b/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift @@ -241,6 +241,7 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC navigationBar.overrideTheme(type: .clear) updateNavigationBar() + updateControlVisibility() } override public func viewDidAppear(_ animated: Bool) { @@ -249,6 +250,7 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC super.viewDidAppear(animated) updateNavigationBar() + updateControlVisibility() } override public func viewWillDisappear(_ animated: Bool) { @@ -262,12 +264,18 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC } override public var canBecomeFirstResponder: Bool { - return true + return !shouldHideControls } // MARK: - Navigation Bar public func updateNavigationBar() { + guard !shouldHideControls else { + self.navigationItem.leftBarButtonItem = nil + self.navigationItem.rightBarButtonItem = nil + return + } + var navigationBarItems = [UIView]() var isShowingCaptionView = false @@ -299,6 +307,27 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC } } + // MARK: - Control Visibility + + public var shouldHideControls: Bool { + guard let pageViewController = pageViewControllers.first else { + return false + } + return pageViewController.shouldHideControls + } + + private func updateControlVisibility() { + if shouldHideControls { + if isFirstResponder { + resignFirstResponder() + } + } else { + if !isFirstResponder { + becomeFirstResponder() + } + } + } + // MARK: - View Helpers func remove(attachmentItem: SignalAttachmentItem) { @@ -376,6 +405,7 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC } updateNavigationBar() + updateControlVisibility() } // MARK: - UIPageViewControllerDataSource @@ -622,7 +652,11 @@ extension AttachmentApprovalViewController: AttachmentPrepViewControllerDelegate } func prepViewControllerUpdateNavigationBar() { - self.updateNavigationBar() + updateNavigationBar() + } + + func prepViewControllerUpdateControls() { + updateControlVisibility() } func prepViewControllerAttachmentCount() -> Int { @@ -682,6 +716,8 @@ protocol AttachmentPrepViewControllerDelegate: class { func prepViewControllerUpdateNavigationBar() + func prepViewControllerUpdateControls() + func prepViewControllerAttachmentCount() -> Int } @@ -712,9 +748,17 @@ public class AttachmentPrepViewController: OWSViewController, PlayerProgressBarD fileprivate var isShowingCaptionView = false { didSet { prepDelegate?.prepViewControllerUpdateNavigationBar() + prepDelegate?.prepViewControllerUpdateControls() } } + public var shouldHideControls: Bool { + guard let imageEditorView = imageEditorView else { + return false + } + return imageEditorView.shouldHideControls + } + // MARK: - Initializers init(attachmentItem: SignalAttachmentItem) { @@ -794,8 +838,7 @@ public class AttachmentPrepViewController: OWSViewController, PlayerProgressBarD view.addSubview(imageEditorView) imageEditorView.autoPinEdgesToSuperviewEdges() - imageEditorView.addControls(to: imageEditorView, - viewController: self) + imageEditorUpdateNavigationBar() } } #endif @@ -872,6 +915,7 @@ public class AttachmentPrepViewController: OWSViewController, PlayerProgressBarD super.viewWillAppear(animated) prepDelegate?.prepViewControllerUpdateNavigationBar() + prepDelegate?.prepViewControllerUpdateControls() } override public func viewDidAppear(_ animated: Bool) { @@ -880,6 +924,7 @@ public class AttachmentPrepViewController: OWSViewController, PlayerProgressBarD super.viewDidAppear(animated) prepDelegate?.prepViewControllerUpdateNavigationBar() + prepDelegate?.prepViewControllerUpdateControls() } override public func viewWillLayoutSubviews() { @@ -1208,6 +1253,10 @@ extension AttachmentPrepViewController: ImageEditorViewDelegate { public func imageEditorUpdateNavigationBar() { prepDelegate?.prepViewControllerUpdateNavigationBar() } + + public func imageEditorUpdateControls() { + prepDelegate?.prepViewControllerUpdateControls() + } } // MARK: - diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorView.swift b/SignalMessaging/Views/ImageEditor/ImageEditorView.swift index 5bba4bc0f..3acac8e1c 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorView.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorView.swift @@ -9,6 +9,7 @@ public protocol ImageEditorViewDelegate: class { func imageEditor(presentFullScreenView viewController: UIViewController, isTransparent: Bool) func imageEditorUpdateNavigationBar() + func imageEditorUpdateControls() } // MARK: - @@ -81,16 +82,17 @@ public class ImageEditorView: UIView { return true } - // TODO: Should this method be private? - @objc - public func addControls(to containerView: UIView, - viewController: UIViewController) { + // MARK: - Navigation Bar + + private func updateNavigationBar() { delegate?.imageEditorUpdateNavigationBar() } - // MARK: - Navigation Bar - public func navigationBarItems() -> [UIView] { + guard !shouldHideControls else { + return [] + } + let undoButton = navigationBarButton(imageName: "image_editor_undo", selector: #selector(didTapUndo(sender:))) let brushButton = navigationBarButton(imageName: "image_editor_brush", @@ -110,6 +112,15 @@ public class ImageEditorView: UIView { return buttons } + private func updateControls() { + delegate?.imageEditorUpdateControls() + } + + public var shouldHideControls: Bool { + // Hide controls during "text item move". + return movingTextItem != nil + } + // MARK: - Actions @objc func didTapUndo(sender: UIButton) { @@ -271,7 +282,12 @@ public class ImageEditorView: UIView { // MARK: - Editor Gesture // These properties are valid while moving a text item. - private var movingTextItem: ImageEditorTextItem? + private var movingTextItem: ImageEditorTextItem? { + didSet { + updateNavigationBar() + updateControls() + } + } private var movingTextStartUnitCenter: CGPoint? private var movingTextHasMoved = false @@ -487,11 +503,11 @@ extension ImageEditorView: ImageEditorModelObserver { public func imageEditorModelDidChange(before: ImageEditorContents, after: ImageEditorContents) { - delegate?.imageEditorUpdateNavigationBar() + updateNavigationBar() } public func imageEditorModelDidChange(changedItemIds: [String]) { - delegate?.imageEditorUpdateNavigationBar() + updateNavigationBar() } } From dd16986d79909efcb5db42a6127ff5b0753c12d8 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 12 Mar 2019 12:25:13 -0400 Subject: [PATCH 14/15] Avoid layout changes due to selection changes in media rail. --- SignalMessaging/Views/GalleryRailView.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/SignalMessaging/Views/GalleryRailView.swift b/SignalMessaging/Views/GalleryRailView.swift index 2e52f9e06..66690ab2a 100644 --- a/SignalMessaging/Views/GalleryRailView.swift +++ b/SignalMessaging/Views/GalleryRailView.swift @@ -64,14 +64,17 @@ public class GalleryRailCellView: UIView { private(set) var isSelected: Bool = false func setIsSelected(_ isSelected: Bool) { + let borderWidth: CGFloat = 2 self.isSelected = isSelected + + // Reserve space for the selection border whether or not the cell is selected. + layoutMargins = UIEdgeInsets(top: 0, left: borderWidth, bottom: 0, right: borderWidth) + if isSelected { - layoutMargins = UIEdgeInsets(top: 0, left: 2, bottom: 0, right: 2) imageView.layer.borderColor = Theme.galleryHighlightColor.cgColor - imageView.layer.borderWidth = 2 - imageView.layer.cornerRadius = 2 + imageView.layer.borderWidth = borderWidth + imageView.layer.cornerRadius = borderWidth } else { - layoutMargins = .zero imageView.layer.borderWidth = 0 imageView.layer.cornerRadius = 0 } From 7521b3a145bb599eb81c1cbf988da26bc567039d Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 12 Mar 2019 12:46:24 -0400 Subject: [PATCH 15/15] Update "attachment has caption" indicator. --- .../image_editor_caption.imageset/Contents.json | 6 +++--- .../add-caption-32@1x.png | Bin 326 -> 0 bytes .../add-caption-32@2x.png | Bin 559 -> 0 bytes .../add-caption-32@3x.png | Bin 866 -> 0 bytes .../caption-24@1x.png | Bin 0 -> 153 bytes .../caption-24@2x.png | Bin 0 -> 190 bytes .../caption-24@3x.png | Bin 0 -> 297 bytes .../AttachmentApprovalViewController.swift | 7 ++++--- .../AttachmentCaptionViewController.swift | 2 +- .../ImageEditor/ImageEditorPaletteView.swift | 3 ++- 10 files changed, 10 insertions(+), 8 deletions(-) delete mode 100644 Signal/Images.xcassets/image_editor_caption.imageset/add-caption-32@1x.png delete mode 100644 Signal/Images.xcassets/image_editor_caption.imageset/add-caption-32@2x.png delete mode 100644 Signal/Images.xcassets/image_editor_caption.imageset/add-caption-32@3x.png create mode 100644 Signal/Images.xcassets/image_editor_caption.imageset/caption-24@1x.png create mode 100644 Signal/Images.xcassets/image_editor_caption.imageset/caption-24@2x.png create mode 100644 Signal/Images.xcassets/image_editor_caption.imageset/caption-24@3x.png diff --git a/Signal/Images.xcassets/image_editor_caption.imageset/Contents.json b/Signal/Images.xcassets/image_editor_caption.imageset/Contents.json index 22defce50..80c4669a0 100644 --- a/Signal/Images.xcassets/image_editor_caption.imageset/Contents.json +++ b/Signal/Images.xcassets/image_editor_caption.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "add-caption-32@1x.png", + "filename" : "caption-24@1x.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "add-caption-32@2x.png", + "filename" : "caption-24@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "add-caption-32@3x.png", + "filename" : "caption-24@3x.png", "scale" : "3x" } ], diff --git a/Signal/Images.xcassets/image_editor_caption.imageset/add-caption-32@1x.png b/Signal/Images.xcassets/image_editor_caption.imageset/add-caption-32@1x.png deleted file mode 100644 index 2d1325e014eecf410f1d981026df1a85d07607f9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3oArNM~bhqvgQ1FMR zi(^Pc>)UA$d7B(~TK7x+Kg^M{K-pqe-T{uj2OND3(guet9eI~YJZRCdv=FNB{J+Kh z_qy*pR-H4!?nAY%;sK`+^w|cR!ECpp6guM%u8S1 z@14pf$XVsOYE{KKMWzEsKl?PqF|DflHb*#NH>bV3f>NZh!ETPwts^$?fdBV}+)3w=0nR-&rsm)XTV>ZcE-YXesK)4@61>=R4 WEb`8ktgnG#z~JfX=d#Wzp$P!D(}NrU diff --git a/Signal/Images.xcassets/image_editor_caption.imageset/add-caption-32@2x.png b/Signal/Images.xcassets/image_editor_caption.imageset/add-caption-32@2x.png deleted file mode 100644 index ba403c8b3fc8b64806371d50524e5d886ef121b3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 559 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=oCO|{#S9E$svykh8Km-ofr0U% zr;B4q#hka%7jq982-L3o6>pZ|c7mhl0Ec8_phTmf5tFh3Q;vgrL8{;t<@DJuSuZD+ z`)^9Io%`T!x3K(2!K9vqW74JH@*1QcuzTuvO>4AKm`4QvO} zEq|@FV76eiV0w|<(|$63p4UV7WDm32jGBoPx0p>XIz6$R@%rl8%7stzl{52-El&pi zH575mXiNR7_(GqddgBwF2W8%6l50=41P3Oc6D|CD{Is3wzEek|Bs^~~2+Xp(vPIKL zWxt&I{BGl{BR5(~_4ImgneC9&UAnewL-*SSmeWtmX0dHanz!zstE@f qy95KI&fq_}X z)5S5QV$R#S7YlDW2(*1Ss^phFBHI!oF#Um00lTK+%LB44LP1Tjjvnk~>;VVU^e%bl zeZS!4@yGFdy|KBRpHS1^lBk~!-a(;?7WWLlMQAYaur@4YFc4vAV>%GPAi>4p%$R^8 zxMzO$cg>}1J8U{U{_Qr@E~%aG^Zx(Id_haA^*Y~WU7jpoC3ohM=9BZxdYMX_gePAA z6Vki&&%AQ+yjz&eslNM2-L0Ev-tdCp)KY* zS#Nzdoo&2-Wm|Og>-8_b`N{lKd+u6vVCLt4N5h%6-+I>3`Ete9Qy2HIUweN7OTJ2r zyQ2ns$hp5i=hQD>b*=SsSC(5mLGjQ zIkI_*p=RPNo&8d!`GW`x_OQNu zQF!OK5|hXdM@G%17xtLVJhp%#wAOU4ip&4G3pW>7RXHl%pZ%!BL_#eQdwi{)+cz(J zS4E};G%AJ9GA@5)7xA9&z_sOzPtVvh(^O`Wd6xZjQI|Z`ld;^-m7chUzHcu(A1nZg z_eD%+(r4E)@(1;|cFuGUX($hWa_-BPZgFn?G`4B0cTQM6W%bMXEB35AYh7ccz5V!P z;Xm68429QsO}-wn>5Q4+&sRs1XHH6u(vLp2sP_N1=Iy>~H|9L$n5GfEv+dB@;~9lZ z1Y_0~WS3^l$xi>o=q=vgyY#x`lmn0M#_q2B_|A#t^!4})X}@g~|1}&o`O$nX!9tn~ hdq5$l)Xt7SjO@lPMcrQ|#DSTH!PC{xWt~$(69E1JZeIWZ diff --git a/Signal/Images.xcassets/image_editor_caption.imageset/caption-24@1x.png b/Signal/Images.xcassets/image_editor_caption.imageset/caption-24@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..5d651236768083334bf6ccb785a39e82294035c4 GIT binary patch literal 153 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GGLLkg|>2BR0prE&> zi(`mK=iAAKTnq|4%)%cZ@3Zlfb#Y;LJ$UDeW7XkMuS1@fF1{7BQ9NNd;ZBv`q#GOz xQ{G)=`@_G?;?tCVW%nbgjmrHS9&BQ8U~QWvxxr|$?PZ{`44$rjF6*2UngE>_GK2sC literal 0 HcmV?d00001 diff --git a/Signal/Images.xcassets/image_editor_caption.imageset/caption-24@2x.png b/Signal/Images.xcassets/image_editor_caption.imageset/caption-24@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..c444e83a99a0a984d6949d80443e13be7bcbe588 GIT binary patch literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC&H|6fVg?2=RS;(M3{v?36fE#` zaSX|5e0$B1tHD5k^$ XpOFZkBlp=GXg7nWtDnm{r-UW|Bq&9U literal 0 HcmV?d00001 diff --git a/Signal/Images.xcassets/image_editor_caption.imageset/caption-24@3x.png b/Signal/Images.xcassets/image_editor_caption.imageset/caption-24@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..740abdfffba21be0280854b96d43cbfb764a47a8 GIT binary patch literal 297 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@ZgvM!oCO|{#S9FJ<{->y95KHND0th` z#WAE}&fA-gTug=n3| zg#ZB!4iPl&yUWk_evj{!I&b+q_aa{wQ0bux_O)B(^0n(ve*}6O;1S)JpLJ? Q1oS3@r>mdKI;Vst0JFkk=Kufz literal 0 HcmV?d00001 diff --git a/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift b/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift index 784828584..40e681eda 100644 --- a/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift +++ b/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift @@ -1460,7 +1460,7 @@ class MediaMessageTextToolbar: UIView, UITextViewDelegate { // Add shadow in case overlayed on white content lengthLimitLabel.layer.shadowColor = UIColor.black.cgColor - lengthLimitLabel.layer.shadowOffset = CGSize(width: 0.0, height: 0.0) + lengthLimitLabel.layer.shadowOffset = .zero lengthLimitLabel.layer.shadowOpacity = 0.8 lengthLimitLabel.isHidden = true @@ -1694,6 +1694,7 @@ public class ApprovalRailCellView: GalleryRailCellView { imageView.layer.shadowColor = UIColor.black.cgColor imageView.layer.shadowRadius = 2 imageView.layer.shadowOpacity = 0.66 + imageView.layer.shadowOffset = .zero return imageView }() @@ -1725,8 +1726,8 @@ public class ApprovalRailCellView: GalleryRailCellView { if hasCaption { addSubview(captionIndicator) - captionIndicator.autoPinEdge(toSuperviewEdge: .top, withInset: 0) - captionIndicator.autoPinEdge(toSuperviewEdge: .leading, withInset: 4) + captionIndicator.autoPinEdge(toSuperviewEdge: .top, withInset: 2) + captionIndicator.autoPinEdge(toSuperviewEdge: .leading, withInset: 6) } else { captionIndicator.removeFromSuperview() } diff --git a/SignalMessaging/ViewControllers/AttachmentCaptionViewController.swift b/SignalMessaging/ViewControllers/AttachmentCaptionViewController.swift index 7b57106b6..e33fe9363 100644 --- a/SignalMessaging/ViewControllers/AttachmentCaptionViewController.swift +++ b/SignalMessaging/ViewControllers/AttachmentCaptionViewController.swift @@ -177,7 +177,7 @@ class AttachmentCaptionViewController: OWSViewController { // Add shadow in case overlayed on white content lengthLimitLabel.layer.shadowColor = UIColor.black.cgColor - lengthLimitLabel.layer.shadowOffset = CGSize(width: 0.0, height: 0.0) + lengthLimitLabel.layer.shadowOffset = .zero lengthLimitLabel.layer.shadowOpacity = 0.8 lengthLimitLabel.isHidden = true diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorPaletteView.swift b/SignalMessaging/Views/ImageEditor/ImageEditorPaletteView.swift index 0ba7170a6..e1c78ff24 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorPaletteView.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorPaletteView.swift @@ -103,8 +103,9 @@ public class ImageEditorPaletteView: UIView { imageView.layer.borderColor = UIColor.white.cgColor imageView.layer.borderWidth = CGHairlineWidth() imageView.layer.shadowColor = UIColor.black.cgColor - imageView.layer.shadowOpacity = 2.0 + imageView.layer.shadowRadius = 2.0 imageView.layer.shadowOpacity = 0.33 + imageView.layer.shadowOffset = .zero selectionWrapper.layoutCallback = { [weak self] (view) in guard let strongSelf = self else { return