mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Various improvements
This commit is contained in:
@@ -1589,6 +1589,13 @@ public extension EmojiPagerContentComponent {
|
||||
return emojiItems
|
||||
}
|
||||
|
||||
enum StickersSubject {
|
||||
case profilePhotoEmojiSelection
|
||||
case groupPhotoEmojiSelection
|
||||
case chatStickers
|
||||
case greetingStickers
|
||||
}
|
||||
|
||||
static func stickerInputData(
|
||||
context: AccountContext,
|
||||
animationCache: AnimationCache,
|
||||
@@ -1601,8 +1608,7 @@ public extension EmojiPagerContentComponent {
|
||||
forceHasPremium: Bool,
|
||||
hasEdit: Bool = false,
|
||||
searchIsPlaceholderOnly: Bool = true,
|
||||
isProfilePhotoEmojiSelection: Bool = false,
|
||||
isGroupPhotoEmojiSelection: Bool = false,
|
||||
subject: StickersSubject = .chatStickers,
|
||||
hideBackground: Bool = false
|
||||
) -> Signal<EmojiPagerContentComponent, NoError> {
|
||||
let premiumConfiguration = PremiumConfiguration.with(appConfiguration: context.currentAppConfiguration.with { $0 })
|
||||
@@ -1652,12 +1658,17 @@ public extension EmojiPagerContentComponent {
|
||||
|
||||
let strings = context.sharedContext.currentPresentationData.with({ $0 }).strings
|
||||
|
||||
//TODO:localize
|
||||
let searchCategories: Signal<EmojiSearchCategories?, NoError>
|
||||
if isProfilePhotoEmojiSelection || isGroupPhotoEmojiSelection {
|
||||
switch subject {
|
||||
case .groupPhotoEmojiSelection, .profilePhotoEmojiSelection:
|
||||
searchCategories = context.engine.stickers.emojiSearchCategories(kind: .avatar)
|
||||
} else {
|
||||
searchCategories = context.engine.stickers.emojiSearchCategories(kind: .emoji)
|
||||
case .chatStickers:
|
||||
searchCategories = context.engine.stickers.emojiSearchCategories(kind: .chatStickers)
|
||||
case .greetingStickers:
|
||||
searchCategories = context.engine.stickers.emojiSearchCategories(kind: .greetingStickers)
|
||||
}
|
||||
|
||||
return combineLatest(
|
||||
context.account.postbox.itemCollectionsView(orderedItemListCollectionIds: stickerOrderedItemListCollectionIds, namespaces: stickerNamespaces, aroundIndex: nil, count: 10000000),
|
||||
hasPremium(context: context, chatPeerId: chatPeerId, premiumIfSavedMessages: false),
|
||||
@@ -2091,6 +2102,14 @@ public extension EmojiPagerContentComponent {
|
||||
)
|
||||
}
|
||||
|
||||
let warpContentsOnEdges: Bool
|
||||
switch subject {
|
||||
case .profilePhotoEmojiSelection, .groupPhotoEmojiSelection:
|
||||
warpContentsOnEdges = true
|
||||
default:
|
||||
warpContentsOnEdges = false
|
||||
}
|
||||
|
||||
return EmojiPagerContentComponent(
|
||||
id: isMasks ? "masks" : "stickers",
|
||||
context: context,
|
||||
@@ -2103,7 +2122,7 @@ public extension EmojiPagerContentComponent {
|
||||
itemLayoutType: .detailed,
|
||||
itemContentUniqueId: nil,
|
||||
searchState: .empty(hasResults: false),
|
||||
warpContentsOnEdges: isProfilePhotoEmojiSelection || isGroupPhotoEmojiSelection,
|
||||
warpContentsOnEdges: warpContentsOnEdges,
|
||||
hideBackground: hideBackground,
|
||||
displaySearchWithPlaceholder: hasSearch ? strings.StickersSearch_SearchStickersPlaceholder : nil,
|
||||
searchCategories: searchCategories,
|
||||
|
||||
Reference in New Issue
Block a user