mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Fix gallery crossfade in animation
This commit is contained in:
parent
383b555437
commit
1e440c199c
@ -329,15 +329,18 @@ open class GalleryControllerNode: ASDisplayNode, UIScrollViewDelegate, UIGesture
|
||||
|
||||
open func animateIn(animateContent: Bool, useSimpleAnimation: Bool) {
|
||||
let duration: Double = animateContent ? 0.2 : 0.3
|
||||
let fadeDuration: Double = 0.2
|
||||
|
||||
let backgroundColor = self.backgroundNode.backgroundColor ?? .black
|
||||
|
||||
self.backgroundNode.backgroundColor = self.backgroundNode.backgroundColor?.withAlphaComponent(0.0)
|
||||
self.statusBar?.alpha = 0.0
|
||||
self.navigationBar?.alpha = 0.0
|
||||
self.footerNode.alpha = 0.0
|
||||
self.currentThumbnailContainerNode?.alpha = 0.0
|
||||
|
||||
UIView.animate(withDuration: duration, animations: {
|
||||
self.backgroundNode.backgroundColor = self.backgroundNode.backgroundColor?.withAlphaComponent(1.0)
|
||||
self.backgroundNode.layer.animate(from: backgroundColor.withAlphaComponent(0.0).cgColor, to: backgroundColor.cgColor, keyPath: "backgroundColor", timingFunction: CAMediaTimingFunctionName.linear.rawValue, duration: fadeDuration)
|
||||
|
||||
UIView.animate(withDuration: fadeDuration, delay: 0.0, options: [.curveLinear], animations: {
|
||||
if !self.areControlsHidden {
|
||||
self.statusBar?.alpha = 1.0
|
||||
self.navigationBar?.alpha = 1.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user