mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Various improvements
This commit is contained in:
parent
31eb1081df
commit
90f09a13e4
134 changed files with 8488 additions and 3171 deletions
|
|
@ -82,7 +82,7 @@ public protocol WallpaperBackgroundNode: ASDisplayNode {
|
|||
var isReady: Signal<Bool, NoError> { get }
|
||||
var rotation: CGFloat { get set }
|
||||
|
||||
func update(wallpaper: TelegramWallpaper)
|
||||
func update(wallpaper: TelegramWallpaper, animated: Bool)
|
||||
func _internalUpdateIsSettingUpWallpaper()
|
||||
func updateLayout(size: CGSize, displayMode: WallpaperDisplayMode, transition: ContainedViewLayoutTransition)
|
||||
func updateIsLooping(_ isLooping: Bool)
|
||||
|
|
@ -920,12 +920,22 @@ final class WallpaperBackgroundNodeImpl: ASDisplayNode, WallpaperBackgroundNode
|
|||
self.dimLayer.opacity = dimAlpha
|
||||
}
|
||||
|
||||
func update(wallpaper: TelegramWallpaper) {
|
||||
func update(wallpaper: TelegramWallpaper, animated: Bool) {
|
||||
if self.wallpaper == wallpaper {
|
||||
return
|
||||
}
|
||||
let previousWallpaper = self.wallpaper
|
||||
self.wallpaper = wallpaper
|
||||
|
||||
|
||||
if let _ = previousWallpaper, animated {
|
||||
if let snapshotView = self.view.snapshotView(afterScreenUpdates: false) {
|
||||
self.view.addSubview(snapshotView)
|
||||
snapshotView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.3, removeOnCompletion: false, completion: { _ in
|
||||
snapshotView.removeFromSuperview()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
var gradientColors: [UInt32] = []
|
||||
var gradientAngle: Int32 = 0
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue