Animated emoji improvements

This commit is contained in:
Ali 2022-07-19 03:38:07 +02:00
parent 2a5b45883d
commit c141531c7b
58 changed files with 3446 additions and 1133 deletions

View file

@ -165,6 +165,7 @@ public protocol AnimatedStickerNode: ASDisplayNode {
var autoplay: Bool { get set }
var visibility: Bool { get set }
var overrideVisibility: Bool { get set }
var isPlayingChanged: (Bool) -> Void { get }
@ -222,6 +223,7 @@ public final class DefaultAnimatedStickerNodeImpl: ASDisplayNode, AnimatedSticke
}
public var autoplay = false
public var overrideVisibility: Bool = false
public var visibility = false {
didSet {
@ -386,7 +388,7 @@ public final class DefaultAnimatedStickerNodeImpl: ASDisplayNode, AnimatedSticke
private func updateIsPlaying() {
if !self.autoplay {
let isPlaying = self.visibility && self.isDisplaying
let isPlaying = self.visibility && (self.isDisplaying || self.overrideVisibility)
if self.isPlaying != isPlaying {
self.isPlaying = isPlaying
if isPlaying {

View file

@ -56,6 +56,8 @@ public final class DirectAnimatedStickerNode: ASDisplayNode, AnimatedStickerNode
}
}
public var overrideVisibility: Bool = false
public var isPlayingChanged: (Bool) -> Void = { _ in }
private var sourceDisposable: Disposable?