From 3384d86415d805a8c9503217cba84370f5c4e3a4 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Thu, 21 Jul 2022 03:47:42 +0200 Subject: [PATCH] Fix animation --- .../Sources/ChatEntityKeyboardInputNode.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/submodules/TelegramUI/Sources/ChatEntityKeyboardInputNode.swift b/submodules/TelegramUI/Sources/ChatEntityKeyboardInputNode.swift index 03f950533a..b77c7bb21e 100644 --- a/submodules/TelegramUI/Sources/ChatEntityKeyboardInputNode.swift +++ b/submodules/TelegramUI/Sources/ChatEntityKeyboardInputNode.swift @@ -1284,7 +1284,17 @@ final class ChatEntityKeyboardInputNode: ChatInputNode { inputData.gifs = gifs var transition: Transition = .immediate - if strongSelf.currentInputData.emoji != inputData.emoji { + var useAnimation = false + + if let pagerView = strongSelf.entityKeyboardView.componentView as? EntityKeyboardComponent.View, let centralId = pagerView.centralId { + if centralId == AnyHashable("emoji") { + useAnimation = strongSelf.currentInputData.emoji != inputData.emoji + } else if centralId == AnyHashable("stickers"), strongSelf.currentInputData.stickers != nil, inputData.stickers != nil { + useAnimation = strongSelf.currentInputData.stickers != inputData.stickers + } + } + + if useAnimation { transition = Transition(animation: .curve(duration: 0.4, curve: .spring)).withUserData(EmojiPagerContentComponent.ContentAnimation(type: .generic)) } strongSelf.currentInputData = inputData