diff --git a/Signal/src/ViewControllers/Photos/PhotoCaptureViewController.swift b/Signal/src/ViewControllers/Photos/PhotoCaptureViewController.swift index 8d4887868..8bcc4fd22 100644 --- a/Signal/src/ViewControllers/Photos/PhotoCaptureViewController.swift +++ b/Signal/src/ViewControllers/Photos/PhotoCaptureViewController.swift @@ -88,7 +88,7 @@ class PhotoCaptureViewController: OWSViewController { return true } - // MARK - + // MARK: - var isRecordingMovie: Bool = false let recordingTimerView = RecordingTimerView() @@ -325,8 +325,7 @@ class PhotoCaptureViewController: OWSViewController { view.addSubview(captureButton) captureButton.autoHCenterInSuperview() - - captureButton.autoPinEdge(toSuperviewMargin: .bottom, withInset: 10) + captureButton.centerYAnchor.constraint(equalTo: view.layoutMarginsGuide.bottomAnchor, constant: SendMediaNavigationController.bottomButtonsCenterOffset).isActive = true } private func showFailureUI(error: Error) { @@ -425,7 +424,7 @@ class CaptureButton: UIView { weak var delegate: CaptureButtonDelegate? let defaultDiameter: CGFloat = ScaleFromIPhone5To7Plus(60, 80) - let recordingDiameter: CGFloat = ScaleFromIPhone5To7Plus(90, 120) + let recordingDiameter: CGFloat = ScaleFromIPhone5To7Plus(68, 120) var innerButtonSizeConstraints: [NSLayoutConstraint]! var zoomIndicatorSizeConstraints: [NSLayoutConstraint]! diff --git a/Signal/src/ViewControllers/Photos/SendMediaNavigationController.swift b/Signal/src/ViewControllers/Photos/SendMediaNavigationController.swift index f579d0b60..98c5de2ff 100644 --- a/Signal/src/ViewControllers/Photos/SendMediaNavigationController.swift +++ b/Signal/src/ViewControllers/Photos/SendMediaNavigationController.swift @@ -18,6 +18,10 @@ protocol SendMediaNavDelegate: AnyObject { @objc class SendMediaNavigationController: OWSNavigationController { + // This is a sensitive constant, if you change it make sure to check + // on iPhone5, 6, 6+, X, layouts. + static let bottomButtonsCenterOffset: CGFloat = -50 + // MARK: - Overrides override var prefersStatusBarHidden: Bool { return true } @@ -27,24 +31,26 @@ class SendMediaNavigationController: OWSNavigationController { self.delegate = self + let bottomButtonsCenterOffset = SendMediaNavigationController.bottomButtonsCenterOffset + view.addSubview(batchModeButton) batchModeButton.setCompressionResistanceHigh() - batchModeButton.autoPinEdge(toSuperviewMargin: .bottom) + batchModeButton.centerYAnchor.constraint(equalTo: view.layoutMarginsGuide.bottomAnchor, constant: bottomButtonsCenterOffset).isActive = true batchModeButton.autoPinEdge(toSuperviewMargin: .trailing) view.addSubview(doneButton) doneButton.setCompressionResistanceHigh() - doneButton.autoPinEdge(toSuperviewMargin: .bottom) + doneButton.centerYAnchor.constraint(equalTo: view.layoutMarginsGuide.bottomAnchor, constant: bottomButtonsCenterOffset).isActive = true doneButton.autoPinEdge(toSuperviewMargin: .trailing) view.addSubview(cameraModeButton) cameraModeButton.setCompressionResistanceHigh() - cameraModeButton.autoPinEdge(toSuperviewMargin: .bottom) + cameraModeButton.centerYAnchor.constraint(equalTo: view.layoutMarginsGuide.bottomAnchor, constant: bottomButtonsCenterOffset).isActive = true cameraModeButton.autoPinEdge(toSuperviewMargin: .leading) view.addSubview(mediaLibraryModeButton) mediaLibraryModeButton.setCompressionResistanceHigh() - mediaLibraryModeButton.autoPinEdge(toSuperviewMargin: .bottom) + mediaLibraryModeButton.centerYAnchor.constraint(equalTo: view.layoutMarginsGuide.bottomAnchor, constant: bottomButtonsCenterOffset).isActive = true mediaLibraryModeButton.autoPinEdge(toSuperviewMargin: .leading) } @@ -439,7 +445,7 @@ private struct AttachmentDraftCollection { return AttachmentDraftCollection(attachmentDrafts: []) } - // MARK - + // MARK: - var count: Int { return attachmentDrafts.count