Merge commit '3cb29347d1da13c0ef115e15a274cff3ae694aa7'

This commit is contained in:
Peter
2018-11-02 22:43:35 +04:00
61 changed files with 5310 additions and 2715 deletions

View File

@@ -1953,7 +1953,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 {
@@ -1975,6 +1976,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: