mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 11:20:18 +00:00
Fix animated emoji blinking after playing
This commit is contained in:
parent
06f609ed26
commit
039228439d
@ -302,10 +302,10 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func removePlaceholder(animated: Bool) {
|
private func removePlaceholder(animated: Bool) {
|
||||||
|
self.placeholderNode.alpha = 0.0
|
||||||
if !animated {
|
if !animated {
|
||||||
self.placeholderNode.removeFromSupernode()
|
self.placeholderNode.removeFromSupernode()
|
||||||
} else {
|
} else {
|
||||||
self.placeholderNode.alpha = 0.0
|
|
||||||
self.placeholderNode.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, completion: { [weak self] _ in
|
self.placeholderNode.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, completion: { [weak self] _ in
|
||||||
self?.placeholderNode.removeFromSupernode()
|
self?.placeholderNode.removeFromSupernode()
|
||||||
})
|
})
|
||||||
@ -425,8 +425,10 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
if !strongSelf.enableSynchronousImageApply {
|
if !strongSelf.enableSynchronousImageApply {
|
||||||
let current = CACurrentMediaTime()
|
let current = CACurrentMediaTime()
|
||||||
if let setupTimestamp = strongSelf.setupTimestamp, current - setupTimestamp > 0.3 {
|
if let setupTimestamp = strongSelf.setupTimestamp, current - setupTimestamp > 0.3 {
|
||||||
strongSelf.animationNode?.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
if !strongSelf.placeholderNode.alpha.isZero {
|
||||||
strongSelf.removePlaceholder(animated: true)
|
strongSelf.animationNode?.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
||||||
|
strongSelf.removePlaceholder(animated: true)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
strongSelf.removePlaceholder(animated: false)
|
strongSelf.removePlaceholder(animated: false)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user