mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Various improvements
This commit is contained in:
@@ -14,6 +14,7 @@ import ContextUI
|
||||
import MoreButtonNode
|
||||
import UndoUI
|
||||
import ShareController
|
||||
import PremiumUI
|
||||
|
||||
private enum StickerPackPreviewGridEntry: Comparable, Identifiable {
|
||||
case sticker(index: Int, stableId: Int, stickerItem: StickerPackItem?, isEmpty: Bool, isPremium: Bool, isLocked: Bool)
|
||||
@@ -369,8 +370,14 @@ private final class StickerPackContainer: ASDisplayNode {
|
||||
}
|
||||
})))
|
||||
}
|
||||
return (itemNode, StickerPreviewPeekContent(account: strongSelf.context.account, theme: strongSelf.presentationData.theme, strings: strongSelf.presentationData.strings, item: .pack(item), isLocked: item.file.isPremiumSticker && !hasPremium, menu: menuItems, openPremiumIntro: {
|
||||
|
||||
return (itemNode, StickerPreviewPeekContent(account: strongSelf.context.account, theme: strongSelf.presentationData.theme, strings: strongSelf.presentationData.strings, item: .pack(item), isLocked: item.file.isPremiumSticker && !hasPremium, menu: menuItems, openPremiumIntro: { [weak self] in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
let controller = PremiumIntroScreen(context: strongSelf.context, source: .stickers)
|
||||
let navigationController = strongSelf.controller?.parentNavigationController
|
||||
strongSelf.controller?.dismiss(animated: false, completion: nil)
|
||||
navigationController?.pushViewController(controller)
|
||||
}))
|
||||
} else {
|
||||
return nil
|
||||
|
||||
@@ -152,7 +152,7 @@ public final class StickerPreviewPeekContentNode: ASDisplayNode, PeekControllerC
|
||||
if isPremiumSticker {
|
||||
animationNode.completed = { [weak self] _ in
|
||||
if let strongSelf = self, let animationNode = strongSelf.animationNode, let additionalAnimationNode = strongSelf.additionalAnimationNode {
|
||||
Queue.mainQueue().after(0.5, {
|
||||
Queue.mainQueue().after(0.1, {
|
||||
animationNode.play()
|
||||
additionalAnimationNode.play()
|
||||
})
|
||||
@@ -250,6 +250,7 @@ final class PremiumStickerPackAccessoryNode: SparseNode, PeekControllerAccessory
|
||||
self.addSubnode(self.cancelButton)
|
||||
|
||||
self.proceedButton.pressed = { [weak self] in
|
||||
self?.dismiss()
|
||||
self?.proceed()
|
||||
}
|
||||
self.cancelButton.addTarget(self, action: #selector(self.cancelPressed), forControlEvents: .touchUpInside)
|
||||
|
||||
Reference in New Issue
Block a user