mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-05 05:51:42 +00:00
Add thumbnails for animated sticker pack preview
This commit is contained in:
parent
6dd1187848
commit
c039d6b2c0
@ -110,10 +110,15 @@ final class StickerPackPreviewGridItemNode: GridItemNode {
|
|||||||
self.textNode.attributedText = NSAttributedString(string: text, font: textFont, textColor: .black, paragraphAlignment: .right)
|
self.textNode.attributedText = NSAttributedString(string: text, font: textFont, textColor: .black, paragraphAlignment: .right)
|
||||||
if let dimensions = stickerItem.file.dimensions {
|
if let dimensions = stickerItem.file.dimensions {
|
||||||
if stickerItem.file.isAnimatedSticker {
|
if stickerItem.file.isAnimatedSticker {
|
||||||
|
self.imageNode.setSignal(chatMessageAnimatedSticker(postbox: account.postbox, file: stickerItem.file, small: false, size: CGSize(width: 160.0, height: 160.0)))
|
||||||
|
|
||||||
if self.animationNode == nil {
|
if self.animationNode == nil {
|
||||||
let animationNode = AnimatedStickerNode()
|
let animationNode = AnimatedStickerNode()
|
||||||
self.animationNode = animationNode
|
self.animationNode = animationNode
|
||||||
self.addSubnode(animationNode)
|
self.addSubnode(animationNode)
|
||||||
|
animationNode.started = { [weak self] in
|
||||||
|
self?.imageNode.isHidden = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
self.animationNode?.setup(account: account, resource: stickerItem.file.resource, width: 160, height: 160, mode: .cached)
|
self.animationNode?.setup(account: account, resource: stickerItem.file.resource, width: 160, height: 160, mode: .cached)
|
||||||
self.animationNode?.visibility = self.isVisibleInGrid
|
self.animationNode?.visibility = self.isVisibleInGrid
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user