Send choosing sticker activity

This commit is contained in:
Ilya Laktyushin
2021-08-25 18:30:43 +03:00
parent 6e1b35a2e3
commit 9d265ef420
4 changed files with 53 additions and 1 deletions

View File

@@ -69,6 +69,9 @@ final class ChatMediaInputStickerPane: ChatMediaInputPane {
private var didScrollPreviousOffset: CGFloat?
private var didScrollPreviousState: ChatMediaInputPaneScrollState?
var beganScrolling: (() -> Void)?
var endedScrolling: (() -> Void)?
init(theme: PresentationTheme, strings: PresentationStrings, paneDidScroll: @escaping (ChatMediaInputPane, ChatMediaInputPaneScrollState, ContainedViewLayoutTransition) -> Void, fixPaneScroll: @escaping (ChatMediaInputPane, ChatMediaInputPaneScrollState) -> Void) {
self.gridNode = GridNode()
self.paneDidScroll = paneDidScroll
@@ -98,12 +101,16 @@ final class ChatMediaInputStickerPane: ChatMediaInputPane {
}
}
}
self.gridNode.scrollingInitiated = { [weak self] in
self?.beganScrolling?()
}
self.gridNode.scrollingCompleted = { [weak self] in
if let strongSelf = self {
if let didScrollPreviousState = strongSelf.didScrollPreviousState {
strongSelf.fixPaneScroll(strongSelf, didScrollPreviousState)
}
fixGridScrolling(strongSelf.gridNode)
strongSelf.endedScrolling?()
}
}
self.gridNode.setupNode = { [weak self] itemNode in