diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 41f9fae58f..e0004ca676 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -7512,16 +7512,18 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G navigationController.pushViewController(self, animated: false) let updatedLayout = self.validLayout - let updatedFrame = self.view.frame if let initialLayout, let updatedLayout, transition.isAnimated { let initialView = self.view.superview + let updatedFrame = self.view.convert(self.view.bounds, to: navigationController.view) navigationController.view.addSubview(self.view) self.view.clipsToBounds = true self.view.frame = initialFrame self.containerLayoutUpdated(initialLayout, transition: .immediate) self.containerLayoutUpdated(updatedLayout, transition: transition) + self.chatDisplayNode.historyNode.layer.animateScaleX(from: initialLayout.size.width / updatedLayout.size.width, to: 1.0, duration: 0.4, timingFunction: kCAMediaTimingFunctionSpring) + self.chatDisplayNode.historyNode.layer.animatePosition(from: CGPoint(x: (updatedLayout.size.width - initialLayout.size.width) / 2.0, y: 0.0), to: .zero, duration: 0.4, timingFunction: kCAMediaTimingFunctionSpring, additive: true) self.view.layer.animate(from: 14.0, to: updatedLayout.deviceMetrics.screenCornerRadius, keyPath: "cornerRadius", timingFunction: kCAMediaTimingFunctionSpring, duration: 0.4) diff --git a/submodules/TelegramUI/Sources/ChatControllerNode.swift b/submodules/TelegramUI/Sources/ChatControllerNode.swift index d9f6f31874..72968eba56 100644 --- a/submodules/TelegramUI/Sources/ChatControllerNode.swift +++ b/submodules/TelegramUI/Sources/ChatControllerNode.swift @@ -1880,9 +1880,9 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate { displayMode = .aspectFit } else if case .compact = layout.metrics.widthClass { if layout.size.width < layout.size.height && layout.size.height < layout.deviceMetrics.screenSize.height { - wallpaperBounds.size.height = layout.deviceMetrics.screenSize.height + wallpaperBounds.size = layout.deviceMetrics.screenSize } else if layout.size.width > layout.size.height && layout.size.height < layout.deviceMetrics.screenSize.width { - wallpaperBounds.size.height = layout.deviceMetrics.screenSize.width + wallpaperBounds.size = layout.deviceMetrics.screenSize } } self.backgroundNode.updateLayout(size: wallpaperBounds.size, displayMode: displayMode, transition: transition) @@ -2296,13 +2296,21 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate { self.navigateButtons.update(rect: apparentNavigateButtonsFrame, within: layout.size, transition: transition) if let titleAccessoryPanelNode = self.titleAccessoryPanelNode, let titleAccessoryPanelFrame, !titleAccessoryPanelNode.frame.equalTo(titleAccessoryPanelFrame) { + let previousFrame = titleAccessoryPanelNode.frame titleAccessoryPanelNode.frame = titleAccessoryPanelFrame - transition.animatePositionAdditive(node: titleAccessoryPanelNode, offset: CGPoint(x: 0.0, y: -titleAccessoryPanelFrame.height)) + if transition.isAnimated && previousFrame.width != titleAccessoryPanelFrame.width { + } else { + transition.animatePositionAdditive(node: titleAccessoryPanelNode, offset: CGPoint(x: 0.0, y: -titleAccessoryPanelFrame.height)) + } } if let chatTranslationPanel = self.chatTranslationPanel, let translationPanelFrame, !chatTranslationPanel.frame.equalTo(translationPanelFrame) { + let previousFrame = chatTranslationPanel.frame chatTranslationPanel.frame = translationPanelFrame - transition.animatePositionAdditive(node: chatTranslationPanel, offset: CGPoint(x: 0.0, y: -translationPanelFrame.height)) + if transition.isAnimated && previousFrame.width != translationPanelFrame.width { + } else { + transition.animatePositionAdditive(node: chatTranslationPanel, offset: CGPoint(x: 0.0, y: -translationPanelFrame.height)) + } } if let chatImportStatusPanel = self.chatImportStatusPanel, let importStatusPanelFrame, !chatImportStatusPanel.frame.equalTo(importStatusPanelFrame) {