diff --git a/submodules/TelegramCore/Sources/State/EmojiSearchCategories.swift b/submodules/TelegramCore/Sources/State/EmojiSearchCategories.swift index 06a108d61b..880dcbfaf4 100644 --- a/submodules/TelegramCore/Sources/State/EmojiSearchCategories.swift +++ b/submodules/TelegramCore/Sources/State/EmojiSearchCategories.swift @@ -146,7 +146,25 @@ func managedSynchronizeEmojiSearchCategories(postbox: Postbox, network: Network, break } - return .complete() + var fileIds: [Int64] = [] + if let cached = _internal_cachedEmojiSearchCategories(transaction: transaction, kind: kind) { + for group in cached.groups { + fileIds.append(group.id) + } + } + return _internal_resolveInlineStickers(postbox: postbox, network: network, fileIds: fileIds) + |> mapToSignal { files -> Signal in + var fetchSignals: Signal = .complete() + for (_, file) in files { + let signal = fetchedMediaResource(mediaBox: postbox.mediaBox, userLocation: .other, userContentType: .other, reference: .standalone(resource: file.resource)) + |> ignoreValues + |> `catch` { _ -> Signal in + return .complete() + } + fetchSignals = fetchSignals |> then(signal) + } + return fetchSignals + } } |> switchToLatest } diff --git a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift index 635bcc49f3..2f0c1b6d94 100644 --- a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift +++ b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift @@ -6485,17 +6485,19 @@ public final class EmojiPagerContentComponent: Component { let searchHeaderFrame = CGRect(origin: CGPoint(x: itemLayout.searchInsets.left, y: itemLayout.searchInsets.top), size: CGSize(width: itemLayout.width - itemLayout.searchInsets.left - itemLayout.searchInsets.right, height: itemLayout.searchHeight)) visibleSearchHeader.update(context: component.context, theme: keyboardChildEnvironment.theme, strings: keyboardChildEnvironment.strings, text: displaySearchWithPlaceholder, useOpaqueTheme: useOpaqueTheme, isActive: self.isSearchActivated, size: searchHeaderFrame.size, canFocus: !component.searchIsPlaceholderOnly, searchCategories: component.searchCategories, transition: transition) - /*transition.attachAnimation(view: visibleSearchHeader, id: "search_transition", completion: { [weak self] completed in - guard let strongSelf = self, completed, let visibleSearchHeader = strongSelf.visibleSearchHeader else { - return - } - - if !strongSelf.isSearchActivated && visibleSearchHeader.superview != strongSelf.scrollView { - strongSelf.scrollView.addSubview(visibleSearchHeader) - strongSelf.mirrorContentScrollView.addSubview(visibleSearchHeader.tintContainerView) - } - })*/ - if visibleSearchHeader.frame != searchHeaderFrame { + if !useOpaqueTheme { + transition.setFrame(view: visibleSearchHeader, frame: searchHeaderFrame) + transition.attachAnimation(view: visibleSearchHeader, id: "search_transition", completion: { [weak self] completed in + guard let strongSelf = self, completed, let visibleSearchHeader = strongSelf.visibleSearchHeader else { + return + } + + if !strongSelf.isSearchActivated && visibleSearchHeader.superview != strongSelf.scrollView { + strongSelf.scrollView.addSubview(visibleSearchHeader) + strongSelf.mirrorContentScrollView.addSubview(visibleSearchHeader.tintContainerView) + } + }) + } else { transition.setFrame(view: visibleSearchHeader, frame: searchHeaderFrame, completion: { [weak self] completed in if !useOpaqueTheme { guard let strongSelf = self, completed, let visibleSearchHeader = strongSelf.visibleSearchHeader else { diff --git a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiSearchSearchBarComponent.swift b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiSearchSearchBarComponent.swift index 3d3ff96944..e91ff3fee0 100644 --- a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiSearchSearchBarComponent.swift +++ b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiSearchSearchBarComponent.swift @@ -15,6 +15,7 @@ import LottieAnimationComponent import EmojiStatusComponent import LottieComponent import LottieComponentEmojiContent +import AudioToolbox private final class RoundMaskView: UIImageView { private var currentDiameter: CGFloat? @@ -214,6 +215,10 @@ final class EmojiSearchSearchBarComponent: Component { private var selectedItem: AnyHashable? + private lazy var hapticFeedback: HapticFeedback = { + return HapticFeedback() + }() + override init(frame: CGRect) { self.tintContainerView = UIView() @@ -281,6 +286,8 @@ final class EmojiSearchSearchBarComponent: Component { self.selectedItem = nil } else { self.selectedItem = AnyHashable(id) + AudioServicesPlaySystemSound(0x450) + self.hapticFeedback.tap() } self.state?.updated(transition: .immediate)