UI improvements

This commit is contained in:
Ali
2023-01-27 02:32:01 +01:00
parent d3aa8f2dc8
commit 2a0ab901ae
9 changed files with 45 additions and 16 deletions

View File

@@ -244,6 +244,7 @@ public final class ChatEntityKeyboardInputNode: ChatInputNode {
private var currentInputData: InputData
private var inputDataDisposable: Disposable?
private var hasRecentGifsDisposable: Disposable?
private let opaqueTopPanelBackground: Bool
private struct EmojiSearchResult {
var groups: [EmojiPagerContentComponent.ItemGroup]
@@ -569,10 +570,11 @@ public final class ChatEntityKeyboardInputNode: ChatInputNode {
private weak var currentUndoOverlayController: UndoOverlayController?
public init(context: AccountContext, currentInputData: InputData, updatedInputData: Signal<InputData, NoError>, defaultToEmojiTab: Bool, controllerInteraction: ChatControllerInteraction?, interfaceInteraction: ChatPanelInterfaceInteraction?, chatPeerId: PeerId?) {
public init(context: AccountContext, currentInputData: InputData, updatedInputData: Signal<InputData, NoError>, defaultToEmojiTab: Bool, opaqueTopPanelBackground: Bool = false, controllerInteraction: ChatControllerInteraction?, interfaceInteraction: ChatPanelInterfaceInteraction?, chatPeerId: PeerId?) {
self.context = context
self.currentInputData = currentInputData
self.defaultToEmojiTab = defaultToEmojiTab
self.opaqueTopPanelBackground = opaqueTopPanelBackground
self.controllerInteraction = controllerInteraction
@@ -1771,7 +1773,7 @@ public final class ChatEntityKeyboardInputNode: ChatInputNode {
defaultToEmojiTab: self.defaultToEmojiTab,
externalTopPanelContainer: self.externalTopPanelContainerImpl,
externalBottomPanelContainer: nil,
displayTopPanelBackground: false,
displayTopPanelBackground: self.opaqueTopPanelBackground ? .opaque : .none,
topPanelExtensionUpdated: { [weak self] topPanelExtension, transition in
guard let strongSelf = self else {
return
@@ -2332,17 +2334,19 @@ public final class EntityInputView: UIInputView, AttachmentTextInputPanelInputVi
)
},
defaultToEmojiTab: true,
opaqueTopPanelBackground: true,
controllerInteraction: nil,
interfaceInteraction: nil,
chatPeerId: nil
)
self.inputNode = inputNode
inputNode.clipContentToTopPanel = hideBackground
inputNode.clipContentToTopPanel = true
inputNode.emojiInputInteraction = inputInteraction
inputNode.externalTopPanelContainerImpl = nil
inputNode.switchToTextInput = { [weak self] in
self?.switchToKeyboard?()
}
inputNode.backgroundColor = self.presentationData.theme.chat.inputMediaPanel.backgroundColor
self.addSubnode(inputNode)
}
}