From 75f68cc6fee0ed4394bb3a56d46f1529aa1c5410 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Mon, 25 Jul 2022 02:27:31 +0200 Subject: [PATCH 1/2] Fix layout --- .../Sources/EntityKeyboardTopPanelComponent.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboardTopPanelComponent.swift b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboardTopPanelComponent.swift index 934c2bafd0..1c4f0fe10e 100644 --- a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboardTopPanelComponent.swift +++ b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboardTopPanelComponent.swift @@ -1090,7 +1090,7 @@ final class EntityKeyboardTopPanelComponent: Component { self.isExpanded = isExpanded self.itemSize = self.isExpanded ? CGSize(width: 54.0, height: 68.0) : CGSize(width: 28.0, height: 28.0) self.staticItemSize = self.itemSize - self.staticExpandedItemSize = self.isExpanded ? self.staticItemSize : CGSize(width: 126.0, height: 28.0) + self.staticExpandedItemSize = self.isExpanded ? self.staticItemSize : CGSize(width: 134.0, height: 28.0) self.innerItemSize = self.isExpanded ? CGSize(width: 50.0, height: 62.0) : CGSize(width: 24.0, height: 24.0) self.itemSpacing = 8.0 From f8801df14372a4a5e7142cb37305ceb4bc36dddb Mon Sep 17 00:00:00 2001 From: Ali <> Date: Mon, 25 Jul 2022 02:32:41 +0200 Subject: [PATCH 2/2] Fix animation --- .../Sources/EmojiPagerContentComponent.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift index 3a9ddba34e..4cc3c0d4fa 100644 --- a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift +++ b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift @@ -3404,7 +3404,7 @@ public final class EmojiPagerContentComponent: Component { itemTransition.setBounds(layer: itemLayer, bounds: CGRect(origin: CGPoint(), size: itemFrame.size)) if animateItemIn, !transition.animation.isImmediate { - if let previousItemPosition = previousItemPositions?[itemId], transitionHintInstalledGroupId != itemId.groupId { + if let previousItemPosition = previousItemPositions?[itemId], transitionHintInstalledGroupId != itemId.groupId, transitionHintExpandedGroupId != itemId.groupId { itemTransition = transition itemLayer.position = previousItemPosition } else { @@ -3437,6 +3437,11 @@ public final class EmojiPagerContentComponent: Component { } } + if animateItemIn, !transition.animation.isImmediate, let contentAnimation = contentAnimation, case .groupExpanded(id: itemGroup.groupId) = contentAnimation.type, let placeholderView = self.visibleItemPlaceholderViews[itemId] { + placeholderView.layer.animateSpring(from: 0.1 as NSNumber, to: 1.0 as NSNumber, keyPath: "transform.scale", duration: 0.4) + placeholderView.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.1) + } + itemLayer.isVisibleForAnimations = true } }