diff --git a/submodules/DrawingUI/Sources/StickerPickerScreen.swift b/submodules/DrawingUI/Sources/StickerPickerScreen.swift index 31874b73a4..7e5720995d 100644 --- a/submodules/DrawingUI/Sources/StickerPickerScreen.swift +++ b/submodules/DrawingUI/Sources/StickerPickerScreen.swift @@ -146,7 +146,7 @@ private final class StickerSelectionComponent: Component { defaultToEmojiTab: false, externalTopPanelContainer: self.panelHostView, externalBottomPanelContainer: nil, - displayTopPanelBackground: true, + displayTopPanelBackground: .blur, topPanelExtensionUpdated: { _, _ in }, hideInputUpdated: { _, _, _ in }, hideTopPanelUpdated: { _, _ in }, diff --git a/submodules/ReactionSelectionNode/Sources/ReactionContextNode.swift b/submodules/ReactionSelectionNode/Sources/ReactionContextNode.swift index bfa7064828..8f09bdb242 100644 --- a/submodules/ReactionSelectionNode/Sources/ReactionContextNode.swift +++ b/submodules/ReactionSelectionNode/Sources/ReactionContextNode.swift @@ -712,6 +712,10 @@ public final class ReactionContextNode: ASDisplayNode, UIScrollViewDelegate { } } + #if DEBUG + loopIdle = true + #endif + var validIndices = Set() var nextX: CGFloat = sideInset for i in 0 ..< self.items.count { diff --git a/submodules/TelegramUI/Components/AvatarEditorScreen/Sources/AvatarEditorScreen.swift b/submodules/TelegramUI/Components/AvatarEditorScreen/Sources/AvatarEditorScreen.swift index dfb972e806..8df063d3a6 100644 --- a/submodules/TelegramUI/Components/AvatarEditorScreen/Sources/AvatarEditorScreen.swift +++ b/submodules/TelegramUI/Components/AvatarEditorScreen/Sources/AvatarEditorScreen.swift @@ -1210,7 +1210,7 @@ final class AvatarEditorScreenComponent: Component { defaultToEmojiTab: true, externalTopPanelContainer: self.panelHostView, externalBottomPanelContainer: nil, - displayTopPanelBackground: true, + displayTopPanelBackground: .blur, topPanelExtensionUpdated: { _, _ in }, hideInputUpdated: { _, _, _ in }, hideTopPanelUpdated: { [weak self] hideTopPanel, transition in diff --git a/submodules/TelegramUI/Components/ChatEntityKeyboardInputNode/Sources/ChatEntityKeyboardInputNode.swift b/submodules/TelegramUI/Components/ChatEntityKeyboardInputNode/Sources/ChatEntityKeyboardInputNode.swift index 6d6c8efc13..e4692ce5fa 100644 --- a/submodules/TelegramUI/Components/ChatEntityKeyboardInputNode/Sources/ChatEntityKeyboardInputNode.swift +++ b/submodules/TelegramUI/Components/ChatEntityKeyboardInputNode/Sources/ChatEntityKeyboardInputNode.swift @@ -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, defaultToEmojiTab: Bool, controllerInteraction: ChatControllerInteraction?, interfaceInteraction: ChatPanelInterfaceInteraction?, chatPeerId: PeerId?) { + public init(context: AccountContext, currentInputData: InputData, updatedInputData: Signal, 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) } } diff --git a/submodules/TelegramUI/Components/EmojiStatusSelectionComponent/Sources/EmojiStatusSelectionComponent.swift b/submodules/TelegramUI/Components/EmojiStatusSelectionComponent/Sources/EmojiStatusSelectionComponent.swift index bb803050ed..bbbfb7608f 100644 --- a/submodules/TelegramUI/Components/EmojiStatusSelectionComponent/Sources/EmojiStatusSelectionComponent.swift +++ b/submodules/TelegramUI/Components/EmojiStatusSelectionComponent/Sources/EmojiStatusSelectionComponent.swift @@ -156,7 +156,7 @@ public final class EmojiStatusSelectionComponent: Component { let topPanelHeight: CGFloat = component.hideTopPanel ? 0.0 : 42.0 let keyboardSize = self.keyboardView.update( - transition: transition.withUserData(EmojiPagerContentComponent.SynchronousLoadBehavior(isDisabled: true)), + transition: transition,//.withUserData(EmojiPagerContentComponent.SynchronousLoadBehavior(isDisabled: true)), component: AnyComponent(EntityKeyboardComponent( theme: component.theme, strings: component.strings, @@ -172,7 +172,7 @@ public final class EmojiStatusSelectionComponent: Component { defaultToEmojiTab: true, externalTopPanelContainer: self.panelHostView, externalBottomPanelContainer: nil, - displayTopPanelBackground: true, + displayTopPanelBackground: .blur, topPanelExtensionUpdated: { _, _ in }, hideInputUpdated: { _, _, _ in }, hideTopPanelUpdated: { [weak self] hideTopPanel, transition in diff --git a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiSearchContent.swift b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiSearchContent.swift index 4564a0d9a8..81d10738c1 100644 --- a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiSearchContent.swift +++ b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiSearchContent.swift @@ -431,7 +431,7 @@ public final class EmojiSearchContent: ASDisplayNode, EntitySearchContainerNode defaultToEmojiTab: true, externalTopPanelContainer: self.panelHostView, externalBottomPanelContainer: nil, - displayTopPanelBackground: true, + displayTopPanelBackground: .blur, topPanelExtensionUpdated: { _, _ in }, hideInputUpdated: { _, _, _ in }, hideTopPanelUpdated: { _, _ in diff --git a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboard.swift b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboard.swift index 01eef81f38..1f3e69607e 100644 --- a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboard.swift +++ b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboard.swift @@ -61,6 +61,12 @@ public final class EntityKeyboardComponent: Component { case masks } + public enum DisplayTopPanelBackground { + case none + case blur + case opaque + } + public struct GifSearchEmoji: Equatable { public var emoji: String public var file: TelegramMediaFile @@ -100,7 +106,7 @@ public final class EntityKeyboardComponent: Component { public let defaultToEmojiTab: Bool public let externalTopPanelContainer: PagerExternalTopPanelContainer? public let externalBottomPanelContainer: PagerExternalTopPanelContainer? - public let displayTopPanelBackground: Bool + public let displayTopPanelBackground: DisplayTopPanelBackground public let topPanelExtensionUpdated: (CGFloat, Transition) -> Void public let hideInputUpdated: (Bool, Bool, Transition) -> Void public let hideTopPanelUpdated: (Bool, Transition) -> Void @@ -132,7 +138,7 @@ public final class EntityKeyboardComponent: Component { defaultToEmojiTab: Bool, externalTopPanelContainer: PagerExternalTopPanelContainer?, externalBottomPanelContainer: PagerExternalTopPanelContainer?, - displayTopPanelBackground: Bool, + displayTopPanelBackground: DisplayTopPanelBackground, topPanelExtensionUpdated: @escaping (CGFloat, Transition) -> Void, hideInputUpdated: @escaping (Bool, Bool, Transition) -> Void, hideTopPanelUpdated: @escaping (Bool, Transition) -> Void, @@ -727,7 +733,7 @@ public final class EntityKeyboardComponent: Component { topPanel: AnyComponent(EntityKeyboardTopContainerPanelComponent( theme: component.theme, overflowHeight: component.hiddenInputHeight, - displayBackground: component.externalTopPanelContainer == nil && component.displayTopPanelBackground + displayBackground: component.externalTopPanelContainer != nil ? .none : component.displayTopPanelBackground )), externalTopPanelContainer: component.externalTopPanelContainer, bottomPanel: component.displayBottomPanel ? AnyComponent(EntityKeyboardBottomPanelComponent( diff --git a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboardTopContainerPanelComponent.swift b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboardTopContainerPanelComponent.swift index 5e2a9d9d36..0d65cbf0a2 100644 --- a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboardTopContainerPanelComponent.swift +++ b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboardTopContainerPanelComponent.swift @@ -38,12 +38,12 @@ final class EntityKeyboardTopContainerPanelComponent: Component { let theme: PresentationTheme let overflowHeight: CGFloat - let displayBackground: Bool + let displayBackground: EntityKeyboardComponent.DisplayTopPanelBackground init( theme: PresentationTheme, overflowHeight: CGFloat, - displayBackground: Bool + displayBackground: EntityKeyboardComponent.DisplayTopPanelBackground ) { self.theme = theme self.overflowHeight = overflowHeight @@ -193,7 +193,9 @@ final class EntityKeyboardTopContainerPanelComponent: Component { strongSelf.updateVisibilityFraction(value: fraction, transition: transition) } - if component.displayBackground { + if case .blur = component.displayBackground { + self.backgroundColor = nil + let backgroundView: BlurredBackgroundView if let current = self.backgroundView { backgroundView = current @@ -216,7 +218,9 @@ final class EntityKeyboardTopContainerPanelComponent: Component { backgroundSeparatorView.backgroundColor = component.theme.chat.inputPanel.panelSeparatorColor transition.setFrame(view: backgroundSeparatorView, frame: CGRect(origin: CGPoint(x: 0.0, y: height), size: CGSize(width: availableSize.width, height: UIScreenPixel))) - } else { + } else if case .none = component.displayBackground { + self.backgroundColor = nil + if let backgroundView = self.backgroundView { self.backgroundView = nil backgroundView.removeFromSuperview() @@ -225,6 +229,17 @@ final class EntityKeyboardTopContainerPanelComponent: Component { self.backgroundSeparatorView = nil backgroundSeparatorView.removeFromSuperview() } + } else if case .opaque = component.displayBackground { + if let backgroundView = self.backgroundView { + self.backgroundView = nil + backgroundView.removeFromSuperview() + } + if let backgroundSeparatorView = self.backgroundSeparatorView { + self.backgroundSeparatorView = nil + backgroundSeparatorView.removeFromSuperview() + } + + self.backgroundColor = component.theme.chat.inputMediaPanel.backgroundColor } return CGSize(width: availableSize.width, height: height) diff --git a/submodules/TelegramUI/Components/ForumCreateTopicScreen/Sources/ForumCreateTopicScreen.swift b/submodules/TelegramUI/Components/ForumCreateTopicScreen/Sources/ForumCreateTopicScreen.swift index 586ec28d1a..2fbbf956d0 100644 --- a/submodules/TelegramUI/Components/ForumCreateTopicScreen/Sources/ForumCreateTopicScreen.swift +++ b/submodules/TelegramUI/Components/ForumCreateTopicScreen/Sources/ForumCreateTopicScreen.swift @@ -408,7 +408,7 @@ private final class TopicIconSelectionComponent: Component { defaultToEmojiTab: true, externalTopPanelContainer: self.panelHostView, externalBottomPanelContainer: nil, - displayTopPanelBackground: true, + displayTopPanelBackground: .blur, topPanelExtensionUpdated: { _, _ in }, hideInputUpdated: { _, _, _ in }, hideTopPanelUpdated: { _, _ in },