Hide reply when selecting stickers

This commit is contained in:
Ali
2021-06-16 23:30:51 +04:00
parent d39ee1493a
commit 0edc08029e
2 changed files with 18 additions and 0 deletions

View File

@@ -1571,6 +1571,15 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
if case let .replyThread(replyThreadMessage) = item.chatLocation, replyThreadMessage.effectiveTopId == item.message.id { if case let .replyThread(replyThreadMessage) = item.chatLocation, replyThreadMessage.effectiveTopId == item.message.id {
return return
} }
let transition: ContainedViewLayoutTransition = animated ? .animated(duration: 0.2, curve: .easeInOut) : .immediate
let replyAlpha: CGFloat = item.controllerInteraction.selectionState == nil ? 1.0 : 0.0
if let replyInfoNode = self.replyInfoNode {
transition.updateAlpha(node: replyInfoNode, alpha: replyAlpha)
}
if let replyBackgroundNode = self.replyBackgroundNode {
transition.updateAlpha(node: replyBackgroundNode, alpha: replyAlpha)
}
if let selectionState = item.controllerInteraction.selectionState { if let selectionState = item.controllerInteraction.selectionState {
var selected = false var selected = false

View File

@@ -1087,6 +1087,15 @@ class ChatMessageStickerItemNode: ChatMessageItemView {
if let item = self.item, item.presentationData.largeEmoji && messageIsElligibleForLargeEmoji(item.message) { if let item = self.item, item.presentationData.largeEmoji && messageIsElligibleForLargeEmoji(item.message) {
isEmoji = true isEmoji = true
} }
let transition: ContainedViewLayoutTransition = animated ? .animated(duration: 0.2, curve: .easeInOut) : .immediate
let replyAlpha: CGFloat = item.controllerInteraction.selectionState == nil ? 1.0 : 0.0
if let replyInfoNode = self.replyInfoNode {
transition.updateAlpha(node: replyInfoNode, alpha: replyAlpha)
}
if let replyBackgroundNode = self.replyBackgroundNode {
transition.updateAlpha(node: replyBackgroundNode, alpha: replyAlpha)
}
if let selectionState = item.controllerInteraction.selectionState { if let selectionState = item.controllerInteraction.selectionState {
let selected = selectionState.selectedIds.contains(item.message.id) let selected = selectionState.selectedIds.contains(item.message.id)