mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Authorization improvements
This commit is contained in:
@@ -263,7 +263,7 @@ public final class SolidRoundedButtonNode: ASDisplayNode {
|
||||
|
||||
self.setupGloss()
|
||||
}
|
||||
|
||||
|
||||
private func setupGloss() {
|
||||
if self.gloss {
|
||||
if self.shimmerView == nil {
|
||||
@@ -312,6 +312,39 @@ public final class SolidRoundedButtonNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
public func animateTitle(from title: String) {
|
||||
let originalTitle = self.title ?? ""
|
||||
self.title = title
|
||||
|
||||
Queue.mainQueue().justDispatch {
|
||||
if let snapshotView = self.titleNode.view.snapshotView(afterScreenUpdates: false) {
|
||||
snapshotView.frame = self.titleNode.frame
|
||||
|
||||
self.view.insertSubview(snapshotView, aboveSubview: self.titleNode.view)
|
||||
snapshotView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak snapshotView] _ in
|
||||
snapshotView?.removeFromSuperview()
|
||||
})
|
||||
self.titleNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
||||
|
||||
self.title = originalTitle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public func animateTitle(to title: String) {
|
||||
if let snapshotView = self.titleNode.view.snapshotView(afterScreenUpdates: false) {
|
||||
snapshotView.frame = self.titleNode.frame
|
||||
|
||||
self.view.insertSubview(snapshotView, aboveSubview: self.titleNode.view)
|
||||
snapshotView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak snapshotView] _ in
|
||||
snapshotView?.removeFromSuperview()
|
||||
})
|
||||
self.titleNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
||||
|
||||
self.title = title
|
||||
}
|
||||
}
|
||||
|
||||
private func setupGradientAnimations() {
|
||||
guard let buttonBackgroundAnimationView = self.buttonBackgroundAnimationView else {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user