mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Avatar improvements
This commit is contained in:
parent
b005b9295c
commit
6ee0ae2cec
@ -6997,6 +6997,7 @@ public final class EmojiPagerContentComponent: Component {
|
|||||||
var recentStatusEmoji: OrderedItemListView?
|
var recentStatusEmoji: OrderedItemListView?
|
||||||
var topReactions: OrderedItemListView?
|
var topReactions: OrderedItemListView?
|
||||||
var recentReactions: OrderedItemListView?
|
var recentReactions: OrderedItemListView?
|
||||||
|
var featuredAvatarEmoji: OrderedItemListView?
|
||||||
for orderedView in view.orderedItemListsViews {
|
for orderedView in view.orderedItemListsViews {
|
||||||
if orderedView.collectionId == Namespaces.OrderedItemList.LocalRecentEmoji {
|
if orderedView.collectionId == Namespaces.OrderedItemList.LocalRecentEmoji {
|
||||||
recentEmoji = orderedView
|
recentEmoji = orderedView
|
||||||
@ -7008,6 +7009,10 @@ public final class EmojiPagerContentComponent: Component {
|
|||||||
recentReactions = orderedView
|
recentReactions = orderedView
|
||||||
} else if orderedView.collectionId == Namespaces.OrderedItemList.CloudTopReactions {
|
} else if orderedView.collectionId == Namespaces.OrderedItemList.CloudTopReactions {
|
||||||
topReactions = orderedView
|
topReactions = orderedView
|
||||||
|
} else if orderedView.collectionId == Namespaces.OrderedItemList.CloudFeaturedProfilePhotoEmoji {
|
||||||
|
featuredAvatarEmoji = orderedView
|
||||||
|
} else if orderedView.collectionId == Namespaces.OrderedItemList.CloudFeaturedProfilePhotoEmoji {
|
||||||
|
featuredAvatarEmoji = orderedView
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7445,9 +7450,66 @@ public final class EmojiPagerContentComponent: Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if isProfilePhotoEmojiSelection || isGroupPhotoEmojiSelection {
|
||||||
|
var existingIds = Set<MediaId>()
|
||||||
|
|
||||||
|
let groupId = "recent"
|
||||||
|
itemGroupIndexById[groupId] = itemGroups.count
|
||||||
|
itemGroups.append(ItemGroup(supergroupId: groupId, id: groupId, title: topStatusTitle?.uppercased(), subtitle: nil, isPremiumLocked: false, isFeatured: false, collapsedLineCount: 5, isClearable: false, headerItem: nil, items: []))
|
||||||
|
|
||||||
|
if let featuredAvatarEmoji = featuredAvatarEmoji {
|
||||||
|
for item in featuredAvatarEmoji.items {
|
||||||
|
guard let item = item.contents.get(RecentMediaItem.self) else {
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if let recentEmoji = recentEmoji, !isReactionSelection, !isStatusSelection {
|
let file = item.media
|
||||||
|
if existingIds.contains(file.fileId) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
existingIds.insert(file.fileId)
|
||||||
|
|
||||||
|
let resultItem: EmojiPagerContentComponent.Item
|
||||||
|
|
||||||
|
var tintMode: Item.TintMode = .none
|
||||||
|
if file.isCustomTemplateEmoji {
|
||||||
|
tintMode = .accent
|
||||||
|
}
|
||||||
|
for attribute in file.attributes {
|
||||||
|
if case let .CustomEmoji(_, _, _, packReference) = attribute {
|
||||||
|
switch packReference {
|
||||||
|
case let .id(id, _):
|
||||||
|
if id == 773947703670341676 || id == 2964141614563343 {
|
||||||
|
tintMode = .accent
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let animationData = EntityKeyboardAnimationData(file: file)
|
||||||
|
resultItem = EmojiPagerContentComponent.Item(
|
||||||
|
animationData: animationData,
|
||||||
|
content: .animation(animationData),
|
||||||
|
itemFile: file,
|
||||||
|
subgroupId: nil,
|
||||||
|
icon: .none,
|
||||||
|
tintMode: tintMode
|
||||||
|
)
|
||||||
|
|
||||||
|
if let groupIndex = itemGroupIndexById[groupId] {
|
||||||
|
if itemGroups[groupIndex].items.count >= (5 + 8) * 8 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
itemGroups[groupIndex].items.append(resultItem)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if let recentEmoji = recentEmoji, !isReactionSelection, !isStatusSelection, !isProfilePhotoEmojiSelection, !isGroupPhotoEmojiSelection {
|
||||||
for item in recentEmoji.items {
|
for item in recentEmoji.items {
|
||||||
guard let item = item.contents.get(RecentEmojiItem.self) else {
|
guard let item = item.contents.get(RecentEmojiItem.self) else {
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user