mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Emoji input improvements
This commit is contained in:
@@ -1031,7 +1031,12 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
|
||||
var insets: UIEdgeInsets
|
||||
var inputPanelBottomInsetTerm: CGFloat = 0.0
|
||||
if inputNodeForState != nil {
|
||||
if let inputNodeForState = inputNodeForState {
|
||||
if !self.inputPanelContainerNode.stableIsExpanded && inputNodeForState.adjustLayoutForHiddenInput {
|
||||
inputNodeForState.hideInput = false
|
||||
inputNodeForState.adjustLayoutForHiddenInput = false
|
||||
}
|
||||
|
||||
insets = layout.insets(options: [])
|
||||
inputPanelBottomInsetTerm = max(insets.bottom, layout.standardInputHeight)
|
||||
} else {
|
||||
@@ -1191,9 +1196,6 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
inputNode.hideInputUpdated = { [weak self] transition in
|
||||
self?.updateInputPanelBackgroundExpansion(transition: transition)
|
||||
}
|
||||
inputNode.expansionFractionUpdated = { [weak self] transition in
|
||||
self?.updateInputPanelBackgroundExpansion(transition: transition)
|
||||
}
|
||||
|
||||
dismissedInputNode = self.inputNode
|
||||
if let inputNode = self.inputNode {
|
||||
@@ -1236,7 +1238,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
|
||||
inputNodeHeightAndOverflow = (
|
||||
boundedHeight,
|
||||
max(0.0, inputHeight - boundedHeight)
|
||||
inputNode.followsDefaultHeight ? max(0.0, inputHeight - boundedHeight) : 0.0
|
||||
)
|
||||
} else if let inputNode = self.inputNode {
|
||||
dismissedInputNode = inputNode
|
||||
@@ -2058,7 +2060,10 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
|
||||
self.historyNode.verticalScrollIndicatorColor = UIColor(white: 0.5, alpha: 0.8)
|
||||
|
||||
let updatedInputFocus = self.chatPresentationInterfaceStateRequiresInputFocus(self.chatPresentationInterfaceState) != self.chatPresentationInterfaceStateRequiresInputFocus(chatPresentationInterfaceState)
|
||||
var updatedInputFocus = self.chatPresentationInterfaceStateRequiresInputFocus(self.chatPresentationInterfaceState) != self.chatPresentationInterfaceStateRequiresInputFocus(chatPresentationInterfaceState)
|
||||
if self.chatPresentationInterfaceStateInputView(self.chatPresentationInterfaceState) !== self.chatPresentationInterfaceStateInputView(chatPresentationInterfaceState) {
|
||||
updatedInputFocus = true
|
||||
}
|
||||
|
||||
let updateInputTextState = self.chatPresentationInterfaceState.interfaceState.effectiveInputState != chatPresentationInterfaceState.interfaceState.effectiveInputState
|
||||
self.chatPresentationInterfaceState = chatPresentationInterfaceState
|
||||
@@ -2171,18 +2176,22 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
self.navigationBar?.setContentNode(nil, animated: transitionIsAnimated)
|
||||
}
|
||||
|
||||
var waitForKeyboardLayout = false
|
||||
if let textView = self.textInputPanelNode?.textInputNode?.textView {
|
||||
let updatedInputView = self.chatPresentationInterfaceStateInputView(chatPresentationInterfaceState)
|
||||
if textView.inputView !== updatedInputView {
|
||||
textView.inputView = updatedInputView
|
||||
if textView.isFirstResponder {
|
||||
if self.chatPresentationInterfaceStateRequiresInputFocus(chatPresentationInterfaceState) {
|
||||
waitForKeyboardLayout = true
|
||||
}
|
||||
textView.reloadInputViews()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if updatedInputFocus {
|
||||
if !self.ignoreUpdateHeight {
|
||||
if !self.ignoreUpdateHeight && !waitForKeyboardLayout {
|
||||
self.scheduleLayoutTransitionRequest(layoutTransition)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user