Recent actions improvements

This commit is contained in:
Ilya Laktyushin
2024-04-23 12:01:28 +04:00
parent 076eb7be4d
commit 914dbc46f6
145 changed files with 295 additions and 215 deletions

View File

@@ -893,14 +893,24 @@ public class ChatMessageInstantVideoItemNode: ChatMessageItemView, ASGestureReco
}
}
strongSelf.addSubnode(actionButtonsNode)
if animation.isAnimated {
actionButtonsNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.25)
}
} else {
if case let .System(duration, _) = animation {
actionButtonsNode.layer.animateFrame(from: previousFrame, to: actionButtonsFrame, duration: duration, timingFunction: kCAMediaTimingFunctionSpring)
}
}
} else if let actionButtonsNode = strongSelf.actionButtonsNode {
actionButtonsNode.removeFromSupernode()
strongSelf.actionButtonsNode = nil
if animation.isAnimated {
actionButtonsNode.layer.animateAlpha(from: actionButtonsNode.alpha, to: 0.0, duration: 0.25, removeOnCompletion: false, completion: { _ in
actionButtonsNode.removeFromSupernode()
})
} else {
actionButtonsNode.removeFromSupernode()
}
}
}
@@ -1253,8 +1263,8 @@ public class ChatMessageInstantVideoItemNode: ChatMessageItemView, ASGestureReco
self.layer.removeAllAnimations()
}
override public func animateInsertion(_ currentTimestamp: Double, duration: Double, short: Bool) {
super.animateInsertion(currentTimestamp, duration: duration, short: short)
override public func animateInsertion(_ currentTimestamp: Double, duration: Double, options: ListViewItemAnimationOptions) {
super.animateInsertion(currentTimestamp, duration: duration, options: options)
self.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
}