mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Refactor text input
This commit is contained in:
@@ -47,6 +47,7 @@ import ChatEmptyNode
|
||||
import SpaceWarpView
|
||||
import ChatSideTopicsPanel
|
||||
import ChatThemeScreen
|
||||
import ChatTextInputPanelNode
|
||||
|
||||
final class VideoNavigationControllerDropContentItem: NavigationControllerDropContentItem {
|
||||
let itemNode: OverlayMediaItemNode
|
||||
@@ -3969,7 +3970,7 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
}
|
||||
|
||||
func sendButtonFrame() -> CGRect? {
|
||||
if let mediaPreviewNode = self.inputPanelNode as? ChatRecordingPreviewInputPanelNode {
|
||||
if let mediaPreviewNode = self.inputPanelNode as? ChatRecordingPreviewInputPanelNodeImpl {
|
||||
return mediaPreviewNode.convert(mediaPreviewNode.sendButton.frame, to: self)
|
||||
} else if let frame = self.textInputPanelNode?.actionButtons.frame {
|
||||
return self.textInputPanelNode?.convert(frame, to: self)
|
||||
@@ -4012,7 +4013,7 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
return textInputPanelNode.frameForInputActionButton().flatMap {
|
||||
return $0.offsetBy(dx: textInputPanelNode.frame.minX, dy: textInputPanelNode.frame.minY)
|
||||
}
|
||||
} else if let recordingPreviewPanelNode = self.inputPanelNode as? ChatRecordingPreviewInputPanelNode {
|
||||
} else if let recordingPreviewPanelNode = self.inputPanelNode as? ChatRecordingPreviewInputPanelNodeImpl {
|
||||
return recordingPreviewPanelNode.frameForInputActionButton().flatMap {
|
||||
return $0.offsetBy(dx: recordingPreviewPanelNode.frame.minX, dy: recordingPreviewPanelNode.frame.minY)
|
||||
}
|
||||
@@ -4761,7 +4762,12 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
}
|
||||
if self.shouldAnimateMessageTransition, let inputPanelNode = self.inputPanelNode as? ChatTextInputPanelNode, let textInput = inputPanelNode.makeSnapshotForTransition() {
|
||||
usedCorrelationId = correlationId
|
||||
let source: ChatMessageTransitionNodeImpl.Source = .textInput(textInput: textInput, replyPanel: replyPanel)
|
||||
let source: ChatMessageTransitionNodeImpl.Source = .textInput(textInput: ChatMessageTransitionNodeImpl.Source.TextInput(
|
||||
backgroundView: textInput.backgroundView,
|
||||
contentView: textInput.contentView,
|
||||
sourceRect: textInput.sourceRect,
|
||||
scrollOffset: textInput.scrollOffset
|
||||
), replyPanel: replyPanel)
|
||||
self.messageTransitionNode.add(correlationId: correlationId, source: source, initiated: {
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user