From 6a5bead5bcef8d5d84dc7af54c3becb2379d64a4 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Thu, 2 Feb 2023 07:09:47 +0400 Subject: [PATCH] Fix gallery push animation --- submodules/GalleryUI/Sources/GalleryController.swift | 4 ++++ submodules/TelegramUI/Sources/ChatController.swift | 3 +++ 2 files changed, 7 insertions(+) diff --git a/submodules/GalleryUI/Sources/GalleryController.swift b/submodules/GalleryUI/Sources/GalleryController.swift index c48b278773..2d18e46444 100644 --- a/submodules/GalleryUI/Sources/GalleryController.swift +++ b/submodules/GalleryUI/Sources/GalleryController.swift @@ -1112,6 +1112,10 @@ public class GalleryController: ViewController, StandalonePresentableController, let animatedOutNode = !simpleAnimation + if let chatController = strongSelf.baseNavigationController?.topViewController as? ChatController { + chatController.updatePushedTransition(0.0, transition: .animated(duration: 0.45, curve: .customSpring(damping: 180.0, initialVelocity: 0.0))) + } + strongSelf.galleryNode.animateOut(animateContent: animatedOutNode, completion: { }) } diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 4e74668a01..1fccb8b2b0 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -18216,6 +18216,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } public func updatePushedTransition(_ fraction: CGFloat, transition: ContainedViewLayoutTransition) { + if !transition.isAnimated { + self.chatDisplayNode.historyNodeContainer.layer.removeAllAnimations() + } let scale: CGFloat = 1.0 - 0.06 * fraction transition.updateTransformScale(node: self.chatDisplayNode.historyNodeContainer, scale: scale) }