diff --git a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift index 6d7451bcf..00dd02442 100644 --- a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift +++ b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift @@ -114,6 +114,8 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC return bottomToolView }() + lazy var touchInterceptorView = UIView() + // MARK: - View Lifecycle public override var prefersStatusBarHidden: Bool { @@ -145,6 +147,12 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC // layout immediately to avoid animating the layout process during the transition self.currentPageViewController.view.layoutIfNeeded() + + view.addSubview(touchInterceptorView) + touchInterceptorView.autoPinEdgesToSuperviewEdges() + touchInterceptorView.isHidden = true + let tapGesture = UITapGestureRecognizer(target: self, action: #selector(didTapTouchInterceptorView(gesture:))) + touchInterceptorView.addGestureRecognizer(tapGesture) } override public func viewWillAppear(_ animated: Bool) { @@ -177,6 +185,8 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC updateNavigationBar() updateInputAccessory() updateControlVisibility() + + touchInterceptorView.isHidden = !isEditingCaptions } // MARK: - Input Accessory @@ -609,6 +619,13 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC // MARK: - Event Handlers + @objc + func didTapTouchInterceptorView(gesture: UITapGestureRecognizer) { + Logger.info("") + + isEditingCaptions = false + } + private func cancelPressed() { self.approvalDelegate?.attachmentApproval(self, didCancelAttachments: attachments) } diff --git a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentPrepViewController.swift b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentPrepViewController.swift index 887565cd4..80dab11b5 100644 --- a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentPrepViewController.swift +++ b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentPrepViewController.swift @@ -57,17 +57,6 @@ public class AttachmentPrepViewController: OWSViewController, PlayerProgressBarD fatalError("init(coder:) has not been implemented") } - // MARK: - Subviews - - // TODO: Do we still need this? - lazy var touchInterceptorView: UIView = { - let touchInterceptorView = UIView() - let tapGesture = UITapGestureRecognizer(target: self, action: #selector(didTapTouchInterceptorView(gesture:))) - touchInterceptorView.addGestureRecognizer(tapGesture) - - return touchInterceptorView - }() - // MARK: - View Lifecycle override public func loadView() { @@ -175,10 +164,6 @@ public class AttachmentPrepViewController: OWSViewController, PlayerProgressBarD playButton.addTarget(self, action: #selector(playButtonTapped), for: .touchUpInside) playButton.autoCenterInSuperview() } - - view.addSubview(touchInterceptorView) - touchInterceptorView.autoPinEdgesToSuperviewEdges() - touchInterceptorView.isHidden = true } override public func viewWillAppear(_ animated: Bool) { @@ -220,12 +205,6 @@ public class AttachmentPrepViewController: OWSViewController, PlayerProgressBarD // MARK: - Event Handlers - @objc - func didTapTouchInterceptorView(gesture: UITapGestureRecognizer) { - Logger.info("") - touchInterceptorView.isHidden = true - } - @objc public func didTapPlayerView(_ gestureRecognizer: UIGestureRecognizer) { assert(self.videoPlayer != nil) diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorBrushViewController.swift b/SignalMessaging/Views/ImageEditor/ImageEditorBrushViewController.swift index 4281208dc..6848b4a13 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorBrushViewController.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorBrushViewController.swift @@ -114,6 +114,11 @@ public class ImageEditorBrushViewController: OWSViewController { paletteView.isHidden = hasStroke } + @objc + public override var prefersStatusBarHidden: Bool { + return true + } + // MARK: - Actions @objc func didTapUndo(sender: UIButton) { diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift b/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift index 3a78f54f6..9714a73c3 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorCropViewController.swift @@ -237,6 +237,11 @@ class ImageEditorCropViewController: OWSViewController { : "image_editor_crop_unlock")) } + @objc + public override var prefersStatusBarHidden: Bool { + return true + } + private static let desiredCornerSize: CGFloat = 24 private static let minCropSize: CGFloat = desiredCornerSize * 2 private var cornerSize = CGSize.zero diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorTextViewController.swift b/SignalMessaging/Views/ImageEditor/ImageEditorTextViewController.swift index f4814c540..53f1f2cfc 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorTextViewController.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorTextViewController.swift @@ -234,6 +234,11 @@ public class ImageEditorTextViewController: OWSViewController, VAlignTextViewDel updateNavigationBar(navigationBarItems: navigationBarItems) } + @objc + public override var prefersStatusBarHidden: Bool { + return true + } + // MARK: - Pinch Gesture private var pinchFontStart: UIFont?