Various emoji search fixes

This commit is contained in:
Ilya Laktyushin 2022-11-27 23:24:25 +04:00
parent b8a7ca4de1
commit 8f459a5104
10 changed files with 58 additions and 18 deletions

View File

@ -8337,3 +8337,5 @@ Sorry for the inconvenience.";
"UserInfo.AnonymousNumberInfo" = "This number is not tied to a SIM card and was acquired on [Fragment]().";
"Login.NewNumber" = "New Number";
"EmojiSearch.SearchEmojiPlaceholder" = "Search Emoji";

View File

@ -533,7 +533,7 @@ final class AuthorizationSequencePhoneEntryControllerNode: ASDisplayNode {
let titleInset: CGFloat = layout.size.width > 320.0 ? 18.0 : 0.0
let additionalBottomInset: CGFloat = layout.size.width > 320.0 ? 80.0 : 10.0
self.titleNode.attributedText = NSAttributedString(string: strings.Login_PhoneTitle, font: Font.bold(28.0), textColor: self.theme.list.itemPrimaryTextColor)
self.titleNode.attributedText = NSAttributedString(string: self.account == nil ? strings.Login_NewNumber : strings.Login_PhoneTitle, font: Font.bold(28.0), textColor: self.theme.list.itemPrimaryTextColor)
let inset: CGFloat = 24.0
let maximumWidth: CGFloat = min(430.0, layout.size.width)

View File

@ -792,6 +792,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
isStandalone: false,
isStatusSelection: true,
isReactionSelection: false,
isEmojiSelection: false,
topReactionItems: [],
areUnicodeEmojiEnabled: false,
areCustomEmojiEnabled: true,

View File

@ -347,6 +347,7 @@ public func quickReactionSetupController(
isStandalone: false,
isStatusSelection: false,
isReactionSelection: true,
isEmojiSelection: false,
isQuickReactionSelection: true,
topReactionItems: [],
areUnicodeEmojiEnabled: false,

View File

@ -1701,8 +1701,7 @@ public final class EmojiSearchHeaderView: UIView, UITextFieldDelegate {
self.clearIconView.isHidden = true
self.clearIconTintView.isHidden = true
self.clearIconButton.isHidden = true
self.deactivated()
if let textField = self.textField {
@ -1711,6 +1710,9 @@ public final class EmojiSearchHeaderView: UIView, UITextFieldDelegate {
textField.resignFirstResponder()
textField.removeFromSuperview()
}
self.tintTextView.view?.isHidden = false
self.textView.view?.isHidden = false
}
@objc private func clearPressed() {
@ -1720,6 +1722,9 @@ public final class EmojiSearchHeaderView: UIView, UITextFieldDelegate {
self.clearIconView.isHidden = true
self.clearIconTintView.isHidden = true
self.clearIconButton.isHidden = true
self.tintTextView.view?.isHidden = false
self.textView.view?.isHidden = false
}
public func textFieldDidBeginEditing(_ textField: UITextField) {
@ -6260,6 +6265,7 @@ public final class EmojiPagerContentComponent: Component {
isStandalone: Bool,
isStatusSelection: Bool,
isReactionSelection: Bool,
isEmojiSelection: Bool,
isTopicIconSelection: Bool = false,
isQuickReactionSelection: Bool = false,
topReactionItems: [EmojiComponentReactionItem],
@ -6977,8 +6983,8 @@ public final class EmojiPagerContentComponent: Component {
displaySearchWithPlaceholder = strings.EmojiSearch_SearchStatusesPlaceholder
} else if isTopicIconSelection {
displaySearchWithPlaceholder = strings.EmojiSearch_SearchTopicIconsPlaceholder
} else {
displaySearchWithPlaceholder = "Search Emoji"
} else if isEmojiSelection {
displaySearchWithPlaceholder = strings.EmojiSearch_SearchEmojiPlaceholder
searchInitiallyHidden = false
}

View File

@ -883,15 +883,22 @@ public final class GifPagerContentComponent: Component {
guard let theme = self.theme else {
return
}
if self.vibrancyEffectView == nil {
let style: UIBlurEffect.Style
style = .extraLight
let blurEffect = UIBlurEffect(style: style)
let vibrancyEffect = UIVibrancyEffect(blurEffect: blurEffect)
let vibrancyEffectView = UIVisualEffectView(effect: vibrancyEffect)
self.vibrancyEffectView = vibrancyEffectView
self.backgroundView.addSubview(vibrancyEffectView)
vibrancyEffectView.contentView.addSubview(self.mirrorContentScrollView)
if theme.overallDarkAppearance {
if let vibrancyEffectView = self.vibrancyEffectView {
self.vibrancyEffectView = nil
vibrancyEffectView.removeFromSuperview()
}
} else {
if self.vibrancyEffectView == nil {
let style: UIBlurEffect.Style
style = .extraLight
let blurEffect = UIBlurEffect(style: style)
let vibrancyEffect = UIVibrancyEffect(blurEffect: blurEffect)
let vibrancyEffectView = UIVisualEffectView(effect: vibrancyEffect)
self.vibrancyEffectView = vibrancyEffectView
self.backgroundView.addSubview(vibrancyEffectView)
vibrancyEffectView.contentView.addSubview(self.mirrorContentScrollView)
}
}
self.backgroundView.updateColor(color: theme.chat.inputMediaPanel.backgroundColor, enableBlur: true, forceKeepBlur: false, transition: transition.containedViewLayoutTransition)
transition.setFrame(view: self.backgroundView, frame: backgroundFrame)

View File

@ -547,6 +547,7 @@ private final class ForumCreateTopicScreenComponent: CombinedComponent {
isStandalone: false,
isStatusSelection: false,
isReactionSelection: false,
isEmojiSelection: false,
isTopicIconSelection: true,
topReactionItems: [],
areUnicodeEmojiEnabled: false,
@ -614,6 +615,7 @@ private final class ForumCreateTopicScreenComponent: CombinedComponent {
isStandalone: false,
isStatusSelection: false,
isReactionSelection: false,
isEmojiSelection: false,
isTopicIconSelection: true,
topReactionItems: [],
areUnicodeEmojiEnabled: false,

View File

@ -1134,6 +1134,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
isStandalone: false,
isStatusSelection: false,
isReactionSelection: true,
isEmojiSelection: false,
topReactionItems: reactionItems,
areUnicodeEmojiEnabled: false,
areCustomEmojiEnabled: true,

View File

@ -90,7 +90,7 @@ final class ChatEntityKeyboardInputNode: ChatInputNode {
let animationCache = context.animationCache
let animationRenderer = context.animationRenderer
let emojiItems = EmojiPagerContentComponent.emojiInputData(context: context, animationCache: animationCache, animationRenderer: animationRenderer, isStandalone: false, isStatusSelection: false, isReactionSelection: false, topReactionItems: [], areUnicodeEmojiEnabled: true, areCustomEmojiEnabled: areCustomEmojiEnabled, chatPeerId: chatPeerId)
let emojiItems = EmojiPagerContentComponent.emojiInputData(context: context, animationCache: animationCache, animationRenderer: animationRenderer, isStandalone: false, isStatusSelection: false, isReactionSelection: false, isEmojiSelection: true, topReactionItems: [], areUnicodeEmojiEnabled: true, areCustomEmojiEnabled: areCustomEmojiEnabled, chatPeerId: chatPeerId)
let stickerNamespaces: [ItemCollectionId.Namespace] = [Namespaces.ItemCollection.CloudStickerPacks]
let stickerOrderedItemListCollectionIds: [Int32] = [Namespaces.OrderedItemList.CloudSavedStickers, Namespaces.OrderedItemList.CloudRecentStickers, Namespaces.OrderedItemList.CloudAllPremiumStickers]
@ -1210,10 +1210,17 @@ final class ChatEntityKeyboardInputNode: ChatInputNode {
|> map { view, availableReactions, hasPremium -> [EmojiPagerContentComponent.ItemGroup] in
var result: [(String, TelegramMediaFile?, String)] = []
var existingEmoticons = Set<String>()
var allEmoticonsList: [String] = []
var allEmoticons: [String: String] = [:]
for keyword in keywords {
for emoticon in keyword.emoticons {
allEmoticons[emoticon] = keyword.keyword
if !existingEmoticons.contains(emoticon) {
allEmoticonsList.append(emoticon)
existingEmoticons.insert(emoticon)
}
}
}
@ -1250,7 +1257,8 @@ final class ChatEntityKeyboardInputNode: ChatInputNode {
let item = EmojiPagerContentComponent.Item(
animationData: animationData,
content: .animation(animationData),
itemFile: itemFile, subgroupId: nil,
itemFile: itemFile,
subgroupId: nil,
icon: .none,
accentTint: false
)
@ -1258,6 +1266,17 @@ final class ChatEntityKeyboardInputNode: ChatInputNode {
}
}
for emoji in allEmoticonsList {
items.append(EmojiPagerContentComponent.Item(
animationData: nil,
content: .staticEmoji(emoji),
itemFile: nil,
subgroupId: nil,
icon: .none,
accentTint: false)
)
}
return [EmojiPagerContentComponent.ItemGroup(
supergroupId: "search",
groupId: "search",
@ -2262,7 +2281,7 @@ final class EntityInputView: UIView, AttachmentTextInputPanelInputView, UIInputV
let semaphore = DispatchSemaphore(value: 0)
var emojiComponent: EmojiPagerContentComponent?
let _ = EmojiPagerContentComponent.emojiInputData(context: context, animationCache: self.animationCache, animationRenderer: self.animationRenderer, isStandalone: true, isStatusSelection: false, isReactionSelection: false, topReactionItems: [], areUnicodeEmojiEnabled: true, areCustomEmojiEnabled: areCustomEmojiEnabled, chatPeerId: nil).start(next: { value in
let _ = EmojiPagerContentComponent.emojiInputData(context: context, animationCache: self.animationCache, animationRenderer: self.animationRenderer, isStandalone: true, isStatusSelection: false, isReactionSelection: false, isEmojiSelection: false, topReactionItems: [], areUnicodeEmojiEnabled: true, areCustomEmojiEnabled: areCustomEmojiEnabled, chatPeerId: nil).start(next: { value in
emojiComponent = value
semaphore.signal()
})
@ -2277,7 +2296,7 @@ final class EntityInputView: UIView, AttachmentTextInputPanelInputView, UIInputV
gifs: nil,
availableGifSearchEmojies: []
),
updatedInputData: EmojiPagerContentComponent.emojiInputData(context: context, animationCache: self.animationCache, animationRenderer: self.animationRenderer, isStandalone: true, isStatusSelection: false, isReactionSelection: false, topReactionItems: [], areUnicodeEmojiEnabled: true, areCustomEmojiEnabled: areCustomEmojiEnabled, chatPeerId: nil) |> map { emojiComponent -> ChatEntityKeyboardInputNode.InputData in
updatedInputData: EmojiPagerContentComponent.emojiInputData(context: context, animationCache: self.animationCache, animationRenderer: self.animationRenderer, isStandalone: true, isStatusSelection: false, isReactionSelection: false, isEmojiSelection: false, topReactionItems: [], areUnicodeEmojiEnabled: true, areCustomEmojiEnabled: areCustomEmojiEnabled, chatPeerId: nil) |> map { emojiComponent -> ChatEntityKeyboardInputNode.InputData in
return ChatEntityKeyboardInputNode.InputData(
emoji: emojiComponent,
stickers: nil,

View File

@ -3362,6 +3362,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
isStandalone: false,
isStatusSelection: true,
isReactionSelection: false,
isEmojiSelection: false,
topReactionItems: [],
areUnicodeEmojiEnabled: false,
areCustomEmojiEnabled: true,