|
|
|
@ -215,11 +215,9 @@ public class AttachmentApprovalViewController: OWSViewController, MessagingToolb
|
|
|
|
self.sendAttachment(captionText: captionText)
|
|
|
|
self.sendAttachment(captionText: captionText)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func messagingToolbar(_ messagingToolbar: MessagingToolbar, didChangeHeight newHeight: CGFloat) {
|
|
|
|
// MARK: Helpers
|
|
|
|
self.scrollView.contentInset.bottom = newHeight
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func sendAttachment(captionText: String?) {
|
|
|
|
private func sendAttachment(captionText: String?) {
|
|
|
|
// disable controls after send was tapped.
|
|
|
|
// disable controls after send was tapped.
|
|
|
|
self.bottomToolbar.isUserInteractionEnabled = false
|
|
|
|
self.bottomToolbar.isUserInteractionEnabled = false
|
|
|
|
|
|
|
|
|
|
|
|
@ -327,7 +325,6 @@ private class GradientView: UIView {
|
|
|
|
|
|
|
|
|
|
|
|
protocol MessagingToolbarDelegate: class {
|
|
|
|
protocol MessagingToolbarDelegate: class {
|
|
|
|
func messagingToolbarDidTapSend(_ messagingToolbar: MessagingToolbar, captionText: String?)
|
|
|
|
func messagingToolbarDidTapSend(_ messagingToolbar: MessagingToolbar, captionText: String?)
|
|
|
|
func messagingToolbar(_ messagingToolbar: MessagingToolbar, didChangeHeight newHeight: CGFloat)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class MessagingToolbar: UIView, UITextViewDelegate {
|
|
|
|
class MessagingToolbar: UIView, UITextViewDelegate {
|
|
|
|
@ -342,14 +339,9 @@ class MessagingToolbar: UIView, UITextViewDelegate {
|
|
|
|
// Otherwise we risk obscuring too much of the content.
|
|
|
|
// Otherwise we risk obscuring too much of the content.
|
|
|
|
return UIDevice.current.orientation.isPortrait ? 160 : 100
|
|
|
|
return UIDevice.current.orientation.isPortrait ? 160 : 100
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let kMinTextViewHeight: CGFloat = 38
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var textViewHeight: CGFloat {
|
|
|
|
let kMinTextViewHeight: CGFloat = 38
|
|
|
|
didSet {
|
|
|
|
var textViewHeight: CGFloat
|
|
|
|
// TODO magic numbers
|
|
|
|
|
|
|
|
self.messagingToolbarDelegate?.messagingToolbar(self, didChangeHeight: textViewHeight + 2 * 4)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
required init?(coder aDecoder: NSCoder) {
|
|
|
|
required init?(coder aDecoder: NSCoder) {
|
|
|
|
fatalError("init(coder:) has not been implemented")
|
|
|
|
fatalError("init(coder:) has not been implemented")
|
|
|
|
|