Merge branch 'charlesmchen/imageEditorFixes3'

pull/2/head
Matthew Chen 6 years ago
commit 76ac745f8b

@ -114,6 +114,8 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
return bottomToolView return bottomToolView
}() }()
lazy var touchInterceptorView = UIView()
// MARK: - View Lifecycle // MARK: - View Lifecycle
public override var prefersStatusBarHidden: Bool { 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 // layout immediately to avoid animating the layout process during the transition
self.currentPageViewController.view.layoutIfNeeded() 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) { override public func viewWillAppear(_ animated: Bool) {
@ -177,6 +185,8 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
updateNavigationBar() updateNavigationBar()
updateInputAccessory() updateInputAccessory()
updateControlVisibility() updateControlVisibility()
touchInterceptorView.isHidden = !isEditingCaptions
} }
// MARK: - Input Accessory // MARK: - Input Accessory
@ -609,6 +619,13 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
// MARK: - Event Handlers // MARK: - Event Handlers
@objc
func didTapTouchInterceptorView(gesture: UITapGestureRecognizer) {
Logger.info("")
isEditingCaptions = false
}
private func cancelPressed() { private func cancelPressed() {
self.approvalDelegate?.attachmentApproval(self, didCancelAttachments: attachments) self.approvalDelegate?.attachmentApproval(self, didCancelAttachments: attachments)
} }

@ -57,17 +57,6 @@ public class AttachmentPrepViewController: OWSViewController, PlayerProgressBarD
fatalError("init(coder:) has not been implemented") 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 // MARK: - View Lifecycle
override public func loadView() { override public func loadView() {
@ -175,10 +164,6 @@ public class AttachmentPrepViewController: OWSViewController, PlayerProgressBarD
playButton.addTarget(self, action: #selector(playButtonTapped), for: .touchUpInside) playButton.addTarget(self, action: #selector(playButtonTapped), for: .touchUpInside)
playButton.autoCenterInSuperview() playButton.autoCenterInSuperview()
} }
view.addSubview(touchInterceptorView)
touchInterceptorView.autoPinEdgesToSuperviewEdges()
touchInterceptorView.isHidden = true
} }
override public func viewWillAppear(_ animated: Bool) { override public func viewWillAppear(_ animated: Bool) {
@ -220,12 +205,6 @@ public class AttachmentPrepViewController: OWSViewController, PlayerProgressBarD
// MARK: - Event Handlers // MARK: - Event Handlers
@objc
func didTapTouchInterceptorView(gesture: UITapGestureRecognizer) {
Logger.info("")
touchInterceptorView.isHidden = true
}
@objc @objc
public func didTapPlayerView(_ gestureRecognizer: UIGestureRecognizer) { public func didTapPlayerView(_ gestureRecognizer: UIGestureRecognizer) {
assert(self.videoPlayer != nil) assert(self.videoPlayer != nil)

@ -114,6 +114,11 @@ public class ImageEditorBrushViewController: OWSViewController {
paletteView.isHidden = hasStroke paletteView.isHidden = hasStroke
} }
@objc
public override var prefersStatusBarHidden: Bool {
return true
}
// MARK: - Actions // MARK: - Actions
@objc func didTapUndo(sender: UIButton) { @objc func didTapUndo(sender: UIButton) {

@ -237,6 +237,11 @@ class ImageEditorCropViewController: OWSViewController {
: "image_editor_crop_unlock")) : "image_editor_crop_unlock"))
} }
@objc
public override var prefersStatusBarHidden: Bool {
return true
}
private static let desiredCornerSize: CGFloat = 24 private static let desiredCornerSize: CGFloat = 24
private static let minCropSize: CGFloat = desiredCornerSize * 2 private static let minCropSize: CGFloat = desiredCornerSize * 2
private var cornerSize = CGSize.zero private var cornerSize = CGSize.zero

@ -234,6 +234,11 @@ public class ImageEditorTextViewController: OWSViewController, VAlignTextViewDel
updateNavigationBar(navigationBarItems: navigationBarItems) updateNavigationBar(navigationBarItems: navigationBarItems)
} }
@objc
public override var prefersStatusBarHidden: Bool {
return true
}
// MARK: - Pinch Gesture // MARK: - Pinch Gesture
private var pinchFontStart: UIFont? private var pinchFontStart: UIFont?

Loading…
Cancel
Save