mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Various improvements
This commit is contained in:
parent
930e237bf1
commit
a37c84aa68
@ -608,6 +608,8 @@ public protocol ChatController: ViewController {
|
||||
func beginMessageSearch(_ query: String)
|
||||
func displayPromoAnnouncement(text: String)
|
||||
|
||||
func updateIsPushed(_ isPushed: Bool)
|
||||
|
||||
func hintPlayNextOutgoingGift()
|
||||
|
||||
var isSendButtonVisible: Bool { get }
|
||||
|
@ -1308,19 +1308,7 @@ open class NavigationController: UINavigationController, ContainableController,
|
||||
self.pushViewController(controller, animated: animated)
|
||||
completion()
|
||||
}
|
||||
|
||||
public func updateContainerPulled(_ pushed: Bool) {
|
||||
guard self.modalContainers.isEmpty else {
|
||||
return
|
||||
}
|
||||
if let rootContainer = self.rootContainer, case let .flat(container) = rootContainer {
|
||||
let scale: CGFloat = pushed ? 1.06 : 1.0
|
||||
|
||||
container.view.layer.transform = CATransform3DMakeScale(scale, scale, 1.0)
|
||||
container.view.layer.animateScale(from: pushed ? 1.0 : 1.06, to: scale, duration: 0.3, timingFunction: kCAMediaTimingFunctionSpring)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
open override func pushViewController(_ viewController: UIViewController, animated: Bool) {
|
||||
var controllers = self.viewControllers
|
||||
controllers.append(viewController)
|
||||
|
@ -17576,6 +17576,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
|
||||
self.chatDisplayNode.historyNodeContainer.layer.addShakeAnimation(amplitude: -6.0, decay: true)
|
||||
}
|
||||
|
||||
public func updateIsPushed(_ isPushed: Bool) {
|
||||
let scale: CGFloat = isPushed ? 0.94 : 1.0
|
||||
let transition = ContainedViewLayoutTransition.animated(duration: 0.45, curve: .customSpring(damping: 180.0, initialVelocity: 0.0))
|
||||
transition.updateTransformScale(node: self.chatDisplayNode.historyNodeContainer, scale: scale)
|
||||
}
|
||||
}
|
||||
|
||||
private final class ContextControllerContentSourceImpl: ContextControllerContentSource {
|
||||
|
@ -1432,7 +1432,9 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
transition.updateFrame(node: self.backgroundNode, frame: contentBounds)
|
||||
self.backgroundNode.updateLayout(size: contentBounds.size, transition: transition)
|
||||
|
||||
transition.updateFrame(node: self.historyNodeContainer, frame: contentBounds)
|
||||
transition.updateBounds(node: self.historyNodeContainer, bounds: contentBounds)
|
||||
transition.updatePosition(node: self.historyNodeContainer, position: contentBounds.center)
|
||||
|
||||
transition.updateBounds(node: self.historyNode, bounds: CGRect(origin: CGPoint(), size: contentBounds.size))
|
||||
transition.updatePosition(node: self.historyNode, position: CGPoint(x: contentBounds.size.width / 2.0, y: contentBounds.size.height / 2.0))
|
||||
if let blurredHistoryNode = self.blurredHistoryNode {
|
||||
|
Loading…
x
Reference in New Issue
Block a user