Fix checks tooltip

This commit is contained in:
Ilya Laktyushin 2022-05-11 20:20:27 +04:00
parent 544b3fa08e
commit d82cb247d2
2 changed files with 22 additions and 20 deletions

View File

@ -15232,7 +15232,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
if let (_, latestStatusNode) = latestNode { if let (_, latestStatusNode) = latestNode {
let bounds = latestStatusNode.view.convert(latestStatusNode.view.bounds, to: self.chatDisplayNode.view) let bounds = latestStatusNode.view.convert(latestStatusNode.view.bounds, to: self.chatDisplayNode.view)
let location = CGPoint(x: bounds.maxX - 7.0, y: bounds.minY + 2.0) let location = CGPoint(x: bounds.maxX - 7.0, y: bounds.minY - 11.0)
let contentNode = ChatStatusChecksTooltipContentNode(presentationData: self.presentationData) let contentNode = ChatStatusChecksTooltipContentNode(presentationData: self.presentationData)
let tooltipController = TooltipController(content: .custom(contentNode), baseFontSize: self.presentationData.listsFontSize.baseDisplaySize, timeout: 3.5, dismissByTapOutside: true, dismissImmediatelyOnLayoutUpdate: true) let tooltipController = TooltipController(content: .custom(contentNode), baseFontSize: self.presentationData.listsFontSize.baseDisplaySize, timeout: 3.5, dismissByTapOutside: true, dismissImmediatelyOnLayoutUpdate: true)

View File

@ -196,13 +196,14 @@ class ChatStatusChecksTooltipContentNode: ASDisplayNode, TooltipControllerCustom
self.deliveredChecksNode.updateState(false, animated: true) self.deliveredChecksNode.updateState(false, animated: true)
self.readChecksNode.updateState(false, animated: true) self.readChecksNode.updateState(false, animated: true)
self.deliveredChecksNode.layer.animateScale(from: 1.0, to: 1.12, duration: 0.25, delay: 0.1, removeOnCompletion: false, completion: { [weak self] _ in Queue.mainQueue().after(0.25) {
self.deliveredChecksNode.layer.animateScale(from: 1.0, to: 1.12, duration: 0.25, delay: 0.0, removeOnCompletion: false, completion: { [weak self] _ in
if let strongSelf = self { if let strongSelf = self {
strongSelf.deliveredChecksNode.layer.animateScale(from: 1.12, to: 1.0, duration: 0.25) strongSelf.deliveredChecksNode.layer.animateScale(from: 1.12, to: 1.0, duration: 0.25)
} }
}) })
self.deliveredTextNode.layer.animateScale(from: 1.0, to: 1.12, duration: 0.25, delay: 0.1, removeOnCompletion: false, completion: { [weak self] _ in self.deliveredTextNode.layer.animateScale(from: 1.0, to: 1.12, duration: 0.25, delay: 0.0, removeOnCompletion: false, completion: { [weak self] _ in
if let strongSelf = self { if let strongSelf = self {
strongSelf.deliveredTextNode.layer.animateScale(from: 1.12, to: 1.0, duration: 0.25) strongSelf.deliveredTextNode.layer.animateScale(from: 1.12, to: 1.0, duration: 0.25)
} }
@ -224,6 +225,7 @@ class ChatStatusChecksTooltipContentNode: ASDisplayNode, TooltipControllerCustom
}) })
} }
} }
}
func updateLayout(size: CGSize) -> CGSize { func updateLayout(size: CGSize) -> CGSize {
let deliveredSize = self.deliveredTextNode.updateLayout(size) let deliveredSize = self.deliveredTextNode.updateLayout(size)