Various improvements

This commit is contained in:
Ilya Laktyushin
2022-05-22 01:05:56 +04:00
parent 1dde73148a
commit b0396c8d15
10 changed files with 68 additions and 19 deletions

View File

@@ -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

View File

@@ -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)