mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 07:28:28 +02:00
this works but we need to expose also the maxCompressed height and the minHeight
This commit is contained in:
@@ -34,10 +34,7 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
|
||||
// MARK: Private
|
||||
private var keyboardHeight: CGFloat = .zero {
|
||||
didSet {
|
||||
let height = UIScreen.main.bounds.height
|
||||
let finalHeight = height - keyboardHeight - 138
|
||||
// TODO: Set the maxHeight in the wysiwygViewModel once exposed
|
||||
return
|
||||
updateTextViewHeight()
|
||||
}
|
||||
}
|
||||
private var voiceMessageToolbarView: VoiceMessageToolbarView?
|
||||
@@ -159,6 +156,7 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
|
||||
name: UIResponder.keyboardWillShowNotification,
|
||||
object: nil
|
||||
)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(deviceDidRotate), name: UIDevice.orientationDidChangeNotification, object: nil)
|
||||
}
|
||||
|
||||
override func customizeRendering() {
|
||||
@@ -169,6 +167,7 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
|
||||
override func dismissKeyboard() {
|
||||
self.viewModel.dismissKeyboard()
|
||||
}
|
||||
|
||||
|
||||
func showKeyboard() {
|
||||
self.viewModel.showKeyboard()
|
||||
@@ -187,6 +186,12 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
|
||||
}
|
||||
}
|
||||
|
||||
@objc private func deviceDidRotate(_ notification: Notification) {
|
||||
DispatchQueue.main.async {
|
||||
self.updateTextViewHeight()
|
||||
}
|
||||
}
|
||||
|
||||
private func updateToolbarHeight(wysiwygHeight: CGFloat) {
|
||||
self.heightConstraint.constant = wysiwygHeight
|
||||
toolbarViewDelegate?.roomInputToolbarView?(self, heightDidChanged: wysiwygHeight, completion: nil)
|
||||
@@ -233,6 +238,14 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
|
||||
wysiwygViewModel.textColor = theme.colors.primaryContent
|
||||
}
|
||||
|
||||
private func updateTextViewHeight() {
|
||||
let height = UIScreen.main.bounds.height
|
||||
let barOffset: CGFloat = 68
|
||||
let toolbarHeight: CGFloat = 118
|
||||
let finalHeight = height - keyboardHeight - toolbarHeight - barOffset
|
||||
wysiwygViewModel.maxExpandedHeight = finalHeight
|
||||
}
|
||||
|
||||
// MARK: - HtmlRoomInputToolbarViewProtocol
|
||||
var isEncryptionEnabled = false {
|
||||
didSet {
|
||||
|
||||
Reference in New Issue
Block a user