mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Added Instant View 2.0 components support
This commit is contained in:
@@ -1916,7 +1916,8 @@ class ChatMessageBubbleItemNode: ChatMessageItemView {
|
||||
}
|
||||
self.item?.controllerInteraction.cancelInteractiveKeyboardGestures()
|
||||
case .changed:
|
||||
let translation = recognizer.translation(in: self.view)
|
||||
var translation = recognizer.translation(in: self.view)
|
||||
translation.x = max(-80.0, min(0.0, translation.x))
|
||||
var animateReplyNodeIn = false
|
||||
if (translation.x < -45.0) != (self.currentSwipeToReplyTranslation < -45.0) {
|
||||
if translation.x < -45.0, self.swipeToReplyNode == nil, let item = self.item {
|
||||
@@ -1938,6 +1939,8 @@ class ChatMessageBubbleItemNode: ChatMessageItemView {
|
||||
if animateReplyNodeIn {
|
||||
swipeToReplyNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.12)
|
||||
swipeToReplyNode.layer.animateSpring(from: 0.1 as NSNumber, to: 1.0 as NSNumber, keyPath: "transform.scale", duration: 0.4)
|
||||
} else {
|
||||
swipeToReplyNode.alpha = min(1.0, abs(translation.x / 45.0))
|
||||
}
|
||||
}
|
||||
case .cancelled, .ended:
|
||||
|
||||
Reference in New Issue
Block a user