From de7eede6ed8a64d8eea78c81b25fc194b0bfd863 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Sat, 23 May 2020 13:47:42 +0300 Subject: [PATCH] Fix build --- .../TelegramUI/Sources/DrawingStickersScreen.swift | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/submodules/TelegramUI/Sources/DrawingStickersScreen.swift b/submodules/TelegramUI/Sources/DrawingStickersScreen.swift index 2be1d2579c..401b709275 100644 --- a/submodules/TelegramUI/Sources/DrawingStickersScreen.swift +++ b/submodules/TelegramUI/Sources/DrawingStickersScreen.swift @@ -194,7 +194,7 @@ private final class DrawingStickersScreenNode: ViewControllerTracingNode { // controller.navigationPresentation = .modal // strongSelf.controllerInteraction.navigationController()?.pushViewController(controller) } - }, toggleSearch: { [weak self] value, searchMode in + }, toggleSearch: { [weak self] value, searchMode, query in if let strongSelf = self { if let searchMode = searchMode, value { var searchContainerNode: PaneSearchContainerNode? @@ -203,9 +203,14 @@ private final class DrawingStickersScreenNode: ViewControllerTracingNode { } else { searchContainerNode = PaneSearchContainerNode(context: strongSelf.context, theme: strongSelf.presentationData.theme, strings: strongSelf.presentationData.strings, controllerInteraction: strongSelf.controllerInteraction, inputNodeInteraction: strongSelf.inputNodeInteraction, mode: searchMode, trendingGifsPromise: Promise(nil), cancel: { self?.searchContainerNode?.deactivate() - self?.inputNodeInteraction.toggleSearch(false, nil) + self?.inputNodeInteraction.toggleSearch(false, nil, "") }) strongSelf.searchContainerNode = searchContainerNode + if !query.isEmpty { + DispatchQueue.main.async { + searchContainerNode?.updateQuery(query) + } + } } if let searchContainerNode = searchContainerNode { strongSelf.searchContainerNodeLoadedDisposable.set((searchContainerNode.ready @@ -644,6 +649,8 @@ private final class DrawingStickersScreenNode: ViewControllerTracingNode { searchContainerNode.frame = containerFrame searchContainerNode.updateLayout(size: containerFrame.size, leftInset: leftInset, rightInset: rightInset, bottomInset: bottomInset, inputHeight: inputHeight, deviceMetrics: deviceMetrics, transition: .immediate) var placeholderNode: PaneSearchBarPlaceholderNode? + var anchorTop = CGPoint(x: 0.0, y: 0.0) + var anchorTopView: UIView = self.view if let searchMode = searchMode { switch searchMode { case .sticker: @@ -658,7 +665,7 @@ private final class DrawingStickersScreenNode: ViewControllerTracingNode { } if let placeholderNode = placeholderNode { - searchContainerNode.animateIn(from: placeholderNode, transition: transition, completion: { [weak self] in + searchContainerNode.animateIn(from: placeholderNode, anchorTop: anchorTop, anhorTopView: anchorTopView, transition: transition, completion: { [weak self] in }) } }