|
|
@ -75,11 +75,6 @@ class AttachmentCaptionViewController: OWSViewController {
|
|
|
|
|
|
|
|
|
|
|
|
configureTextView()
|
|
|
|
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 doneIcon = UIImage(named: "image_editor_checkmark_full")?.withRenderingMode(.alwaysTemplate)
|
|
|
|
let doneButton = UIBarButtonItem(image: doneIcon, style: .plain,
|
|
|
|
let doneButton = UIBarButtonItem(image: doneIcon, style: .plain,
|
|
|
|
target: self,
|
|
|
|
target: self,
|
|
|
@ -96,7 +91,6 @@ class AttachmentCaptionViewController: OWSViewController {
|
|
|
|
stackView.axis = .vertical
|
|
|
|
stackView.axis = .vertical
|
|
|
|
stackView.spacing = 20
|
|
|
|
stackView.spacing = 20
|
|
|
|
stackView.alignment = .fill
|
|
|
|
stackView.alignment = .fill
|
|
|
|
stackView.addBackgroundView(withBackgroundColor: UIColor(white: 0, alpha: 0.5))
|
|
|
|
|
|
|
|
stackView.layoutMargins = UIEdgeInsets(top: 16, left: 20, bottom: 16, right: 20)
|
|
|
|
stackView.layoutMargins = UIEdgeInsets(top: 16, left: 20, bottom: 16, right: 20)
|
|
|
|
stackView.isLayoutMarginsRelativeArrangement = true
|
|
|
|
stackView.isLayoutMarginsRelativeArrangement = true
|
|
|
|
self.view.addSubview(stackView)
|
|
|
|
self.view.addSubview(stackView)
|
|
|
@ -104,6 +98,15 @@ class AttachmentCaptionViewController: OWSViewController {
|
|
|
|
stackView.autoPinEdge(toSuperviewEdge: .trailing)
|
|
|
|
stackView.autoPinEdge(toSuperviewEdge: .trailing)
|
|
|
|
self.autoPinView(toBottomOfViewControllerOrKeyboard: stackView, avoidNotch: true)
|
|
|
|
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
|
|
|
|
let minTextHeight: CGFloat = textView.font?.lineHeight ?? 0
|
|
|
|
textViewHeightConstraint = textView.autoSetDimension(.height, toSize: minTextHeight)
|
|
|
|
textViewHeightConstraint = textView.autoSetDimension(.height, toSize: minTextHeight)
|
|
|
|
|
|
|
|
|
|
|
|