Fix webpage transcription animation

This commit is contained in:
Ali
2022-05-31 16:30:49 +04:00
parent 7cb9f925bd
commit 3f3741ab89
3 changed files with 23 additions and 7 deletions

View File

@@ -235,6 +235,7 @@ final class ChatMessageAttachedContentNode: ASDisplayNode {
var openMedia: ((InteractiveMediaNodeActivateContent) -> Void)?
var activateAction: (() -> Void)?
var requestUpdateLayout: (() -> Void)?
var visibility: ListViewItemNodeVisibility = .none {
didSet {
@@ -837,7 +838,7 @@ final class ChatMessageAttachedContentNode: ASDisplayNode {
strongSelf.theme = presentationData.theme
strongSelf.lineNode.image = lineImage
strongSelf.lineNode.frame = CGRect(origin: CGPoint(x: 13.0, y: insets.top), size: CGSize(width: 2.0, height: adjustedLineHeight - insets.top - insets.bottom - 2.0))
animation.animator.updateFrame(layer: strongSelf.lineNode.layer, frame: CGRect(origin: CGPoint(x: 13.0, y: insets.top), size: CGSize(width: 2.0, height: adjustedLineHeight - insets.top - insets.bottom - 2.0)), completion: nil)
strongSelf.lineNode.isHidden = !displayLine
strongSelf.textNode.displaysAsynchronously = !isPreview
@@ -931,6 +932,11 @@ final class ChatMessageAttachedContentNode: ASDisplayNode {
strongSelf.openMedia?(.default)
}
}
contentFileNode.requestUpdateLayout = { [weak strongSelf] _ in
if let strongSelf = strongSelf {
strongSelf.requestUpdateLayout?()
}
}
}
if let (_, flags) = mediaAndFlags, flags.contains(.preferMediaBeforeText) {
contentFileNode.frame = CGRect(origin: CGPoint(x: insets.left, y: insets.top), size: contentFileSize)