Update animation

This commit is contained in:
Ali 2021-04-18 13:49:22 +04:00
parent d73c4b65e0
commit 0ab87d6bbc
2 changed files with 10 additions and 13 deletions

View File

@ -174,6 +174,10 @@ final class ChatMessageTransitionNode: ASDisplayNode {
}
func beginAnimation() {
let verticalDuration: Double = 0.5
let horizontalDuration: Double = verticalDuration * 0.5
let delay: Double = 0.0
switch self.source {
case let .textInput(textInput, replyPanel):
self.contextSourceNode.isExtractedToContextPreview = true
@ -195,10 +199,6 @@ final class ChatMessageTransitionNode: ASDisplayNode {
self.itemNode.cancelInsertionAnimations()
let verticalDuration: Double = 0.5
let horizontalDuration: Double = verticalDuration * 0.7
let delay: Double = 0.0
let transition: ContainedViewLayoutTransition = .animated(duration: horizontalDuration, curve: .custom(0.33, 0.0, 0.0, 1.0))
if let itemNode = self.itemNode as? ChatMessageBubbleItemNode {
@ -264,10 +264,6 @@ final class ChatMessageTransitionNode: ASDisplayNode {
self.itemNode.cancelInsertionAnimations()
let verticalDuration: Double = 0.5
let horizontalDuration: Double = verticalDuration * 0.25
let delay: Double = 0.0
let transition: ContainedViewLayoutTransition = .animated(duration: horizontalDuration, curve: .custom(0.33, 0.0, 0.0, 1.0))
if let itemNode = self.itemNode as? ChatMessageAnimatedStickerItemNode {
@ -314,10 +310,6 @@ final class ChatMessageTransitionNode: ASDisplayNode {
container.isHidden = true
let verticalDuration: Double = 0.5
let horizontalDuration: Double = verticalDuration * 0.7
let delay: Double = 0.0
let transition: ContainedViewLayoutTransition = .animated(duration: horizontalDuration, curve: .custom(0.33, 0.0, 0.0, 1.0))
if let itemNode = self.itemNode as? ChatMessageBubbleItemNode {

View File

@ -2182,9 +2182,14 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
let backgroundView = UIImageView(image: backgroundImage)
backgroundView.frame = self.textInputBackgroundNode.frame
guard let contentView = textInputNode.view.snapshotView(afterScreenUpdates: false) else {
//let previousTintColor = textInputNode.view.tintColor
//textInputNode.view.tintColor = .clear
guard let contentView = textInputNode.view.snapshotView(afterScreenUpdates: true) else {
//textInputNode.view.tintColor = previousTintColor
return nil
}
//textInputNode.view.tintColor = previousTintColor
contentView.frame = textInputNode.frame
return ChatMessageTransitionNode.Source.TextInput(