mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Add emoji tab loading indicator
This commit is contained in:
parent
9e35583dae
commit
7be540c30b
@ -472,7 +472,7 @@ public final class ReactionContextNode: ASDisplayNode, UIScrollViewDelegate {
|
|||||||
var emojiContent = emojiContent
|
var emojiContent = emojiContent
|
||||||
if let emojiSearchResult = emojiSearchState.result {
|
if let emojiSearchResult = emojiSearchState.result {
|
||||||
var emptySearchResults: EmojiPagerContentComponent.EmptySearchResults?
|
var emptySearchResults: EmojiPagerContentComponent.EmptySearchResults?
|
||||||
if !emojiSearchResult.groups.contains(where: { !$0.items.isEmpty }) {
|
if !emojiSearchResult.groups.contains(where: { !$0.items.isEmpty || $0.fillWithLoadingPlaceholders }) {
|
||||||
if strongSelf.stableEmptyResultEmoji == nil {
|
if strongSelf.stableEmptyResultEmoji == nil {
|
||||||
strongSelf.stableEmptyResultEmoji = strongSelf.emptyResultEmojis.randomElement()
|
strongSelf.stableEmptyResultEmoji = strongSelf.emptyResultEmojis.randomElement()
|
||||||
}
|
}
|
||||||
@ -1545,7 +1545,25 @@ public final class ReactionContextNode: ASDisplayNode, UIScrollViewDelegate {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if group.items.isEmpty && !result.isFinalResult {
|
if group.items.isEmpty && !result.isFinalResult {
|
||||||
self.emojiSearchStateValue.isSearching = true
|
//self.emojiSearchStateValue.isSearching = true
|
||||||
|
self.emojiSearchStateValue = EmojiSearchState(result: EmojiSearchResult(groups: [
|
||||||
|
EmojiPagerContentComponent.ItemGroup(
|
||||||
|
supergroupId: "search",
|
||||||
|
groupId: "search",
|
||||||
|
title: nil,
|
||||||
|
subtitle: nil,
|
||||||
|
actionButtonTitle: nil,
|
||||||
|
isFeatured: false,
|
||||||
|
isPremiumLocked: false,
|
||||||
|
isEmbedded: false,
|
||||||
|
hasClear: false,
|
||||||
|
collapsedLineCount: nil,
|
||||||
|
displayPremiumBadges: false,
|
||||||
|
headerItem: nil,
|
||||||
|
fillWithLoadingPlaceholders: true,
|
||||||
|
items: []
|
||||||
|
)
|
||||||
|
], id: AnyHashable(value), version: version, isPreset: true), isSearching: false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -530,7 +530,25 @@ final class AvatarEditorScreenComponent: Component {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if group.items.isEmpty && !result.isFinalResult {
|
if group.items.isEmpty && !result.isFinalResult {
|
||||||
self.emojiSearchStateValue.isSearching = true
|
//self.emojiSearchStateValue.isSearching = true
|
||||||
|
self.emojiSearchStateValue = EmojiSearchState(result: EmojiSearchResult(groups: [
|
||||||
|
EmojiPagerContentComponent.ItemGroup(
|
||||||
|
supergroupId: "search",
|
||||||
|
groupId: "search",
|
||||||
|
title: nil,
|
||||||
|
subtitle: nil,
|
||||||
|
actionButtonTitle: nil,
|
||||||
|
isFeatured: false,
|
||||||
|
isPremiumLocked: false,
|
||||||
|
isEmbedded: false,
|
||||||
|
hasClear: false,
|
||||||
|
collapsedLineCount: nil,
|
||||||
|
displayPremiumBadges: false,
|
||||||
|
headerItem: nil,
|
||||||
|
fillWithLoadingPlaceholders: true,
|
||||||
|
items: []
|
||||||
|
)
|
||||||
|
], id: AnyHashable(value), version: version, isPreset: true), isSearching: false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -910,7 +928,7 @@ final class AvatarEditorScreenComponent: Component {
|
|||||||
if let searchResult = emojiSearchState.result {
|
if let searchResult = emojiSearchState.result {
|
||||||
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||||
var emptySearchResults: EmojiPagerContentComponent.EmptySearchResults?
|
var emptySearchResults: EmojiPagerContentComponent.EmptySearchResults?
|
||||||
if !searchResult.groups.contains(where: { !$0.items.isEmpty }) {
|
if !searchResult.groups.contains(where: { !$0.items.isEmpty || $0.fillWithLoadingPlaceholders }) {
|
||||||
emptySearchResults = EmojiPagerContentComponent.EmptySearchResults(
|
emptySearchResults = EmojiPagerContentComponent.EmptySearchResults(
|
||||||
text: presentationData.strings.EmojiSearch_SearchEmojiEmptyResult,
|
text: presentationData.strings.EmojiSearch_SearchEmojiEmptyResult,
|
||||||
iconFile: nil
|
iconFile: nil
|
||||||
|
@ -383,7 +383,7 @@ public final class EmojiStatusSelectionController: ViewController {
|
|||||||
var emojiContent = emojiContent
|
var emojiContent = emojiContent
|
||||||
if let emojiSearchResult = emojiSearchState.result {
|
if let emojiSearchResult = emojiSearchState.result {
|
||||||
var emptySearchResults: EmojiPagerContentComponent.EmptySearchResults?
|
var emptySearchResults: EmojiPagerContentComponent.EmptySearchResults?
|
||||||
if !emojiSearchResult.groups.contains(where: { !$0.items.isEmpty }) {
|
if !emojiSearchResult.groups.contains(where: { !$0.items.isEmpty || $0.fillWithLoadingPlaceholders }) {
|
||||||
if strongSelf.stableEmptyResultEmoji == nil {
|
if strongSelf.stableEmptyResultEmoji == nil {
|
||||||
strongSelf.stableEmptyResultEmoji = strongSelf.emptyResultEmojis.randomElement()
|
strongSelf.stableEmptyResultEmoji = strongSelf.emptyResultEmojis.randomElement()
|
||||||
}
|
}
|
||||||
@ -638,7 +638,25 @@ public final class EmojiStatusSelectionController: ViewController {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if group.items.isEmpty && !result.isFinalResult {
|
if group.items.isEmpty && !result.isFinalResult {
|
||||||
self.emojiSearchStateValue.isSearching = true
|
//self.emojiSearchStateValue.isSearching = true
|
||||||
|
self.emojiSearchStateValue = EmojiSearchState(result: EmojiSearchResult(groups: [
|
||||||
|
EmojiPagerContentComponent.ItemGroup(
|
||||||
|
supergroupId: "search",
|
||||||
|
groupId: "search",
|
||||||
|
title: nil,
|
||||||
|
subtitle: nil,
|
||||||
|
actionButtonTitle: nil,
|
||||||
|
isFeatured: false,
|
||||||
|
isPremiumLocked: false,
|
||||||
|
isEmbedded: false,
|
||||||
|
hasClear: false,
|
||||||
|
collapsedLineCount: nil,
|
||||||
|
displayPremiumBadges: false,
|
||||||
|
headerItem: nil,
|
||||||
|
fillWithLoadingPlaceholders: true,
|
||||||
|
items: []
|
||||||
|
)
|
||||||
|
], id: AnyHashable(value), version: version, isPreset: true), isSearching: false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4421,7 +4421,7 @@ public final class EmojiPagerContentComponent: Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func scrollToItemGroup(id supergroupId: AnyHashable, subgroupId: Int32?, animated: Bool) {
|
public func scrollToItemGroup(id supergroupId: AnyHashable, subgroupId: Int32?, animated: Bool) {
|
||||||
guard let component = self.component, let itemGroup = component.contentItemGroups.first(where: { $0.supergroupId == supergroupId }), let pagerEnvironment = self.pagerEnvironment, let itemLayout = self.itemLayout else {
|
guard let component = self.component, let pagerEnvironment = self.pagerEnvironment, let itemLayout = self.itemLayout else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4430,6 +4430,10 @@ public final class EmojiPagerContentComponent: Component {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
guard let itemGroup = component.contentItemGroups.first(where: { $0.supergroupId == supergroupId }) else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
for groupIndex in 0 ..< itemLayout.itemGroupLayouts.count {
|
for groupIndex in 0 ..< itemLayout.itemGroupLayouts.count {
|
||||||
let group = itemLayout.itemGroupLayouts[groupIndex]
|
let group = itemLayout.itemGroupLayouts[groupIndex]
|
||||||
|
|
||||||
|
@ -359,7 +359,25 @@ public final class EmojiSearchContent: ASDisplayNode, EntitySearchContainerNode
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if group.items.isEmpty && !result.isFinalResult {
|
if group.items.isEmpty && !result.isFinalResult {
|
||||||
self.emojiSearchStateValue.isSearching = true
|
//self.emojiSearchStateValue.isSearching = true
|
||||||
|
self.emojiSearchStateValue = EmojiSearchState(result: EmojiSearchResult(groups: [
|
||||||
|
EmojiPagerContentComponent.ItemGroup(
|
||||||
|
supergroupId: "search",
|
||||||
|
groupId: "search",
|
||||||
|
title: nil,
|
||||||
|
subtitle: nil,
|
||||||
|
actionButtonTitle: nil,
|
||||||
|
isFeatured: false,
|
||||||
|
isPremiumLocked: false,
|
||||||
|
isEmbedded: false,
|
||||||
|
hasClear: false,
|
||||||
|
collapsedLineCount: nil,
|
||||||
|
displayPremiumBadges: false,
|
||||||
|
headerItem: nil,
|
||||||
|
fillWithLoadingPlaceholders: true,
|
||||||
|
items: []
|
||||||
|
)
|
||||||
|
], id: AnyHashable(value), version: version, isPreset: true), isSearching: false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -444,7 +462,7 @@ public final class EmojiSearchContent: ASDisplayNode, EntitySearchContainerNode
|
|||||||
|
|
||||||
if let emojiSearchResult = self.immediateEmojiSearchState.result {
|
if let emojiSearchResult = self.immediateEmojiSearchState.result {
|
||||||
var emptySearchResults: EmojiPagerContentComponent.EmptySearchResults?
|
var emptySearchResults: EmojiPagerContentComponent.EmptySearchResults?
|
||||||
if !emojiSearchResult.groups.contains(where: { !$0.items.isEmpty }) {
|
if !emojiSearchResult.groups.contains(where: { !$0.items.isEmpty || $0.fillWithLoadingPlaceholders }) {
|
||||||
emptySearchResults = EmojiPagerContentComponent.EmptySearchResults(
|
emptySearchResults = EmojiPagerContentComponent.EmptySearchResults(
|
||||||
text: self.presentationData.strings.EmojiSearch_SearchEmojiEmptyResult,
|
text: self.presentationData.strings.EmojiSearch_SearchEmojiEmptyResult,
|
||||||
iconFile: nil
|
iconFile: nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user