mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various fixes
This commit is contained in:
parent
f2efd60154
commit
a573daa949
@ -3347,6 +3347,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
|
||||
if progress == 1.0 {
|
||||
for itemNode in temporaryPreviousNodes {
|
||||
itemNode.visibility = .none
|
||||
itemNode.removeFromSupernode()
|
||||
itemNode.extractedBackgroundNode?.removeFromSupernode()
|
||||
}
|
||||
@ -3360,6 +3361,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
} else {
|
||||
animation.completion = { _ in
|
||||
for itemNode in temporaryPreviousNodes {
|
||||
itemNode.visibility = .none
|
||||
itemNode.removeFromSupernode()
|
||||
itemNode.extractedBackgroundNode?.removeFromSupernode()
|
||||
}
|
||||
@ -3442,6 +3444,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
private func removeItemNodeAtIndex(_ index: Int) {
|
||||
let node = self.itemNodes[index]
|
||||
self.itemNodes.remove(at: index)
|
||||
node.visibility = .none
|
||||
node.removeFromSupernode()
|
||||
node.extractedBackgroundNode?.removeFromSupernode()
|
||||
node.accessoryItemNode?.removeFromSupernode()
|
||||
|
@ -402,11 +402,11 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
||||
}
|
||||
}
|
||||
|
||||
private var visibilityStatus: Bool = false {
|
||||
private var visibilityStatus: Bool? {
|
||||
didSet {
|
||||
if self.visibilityStatus != oldValue {
|
||||
self.updateVisibility()
|
||||
self.haptic?.enabled = self.visibilityStatus
|
||||
self.haptic?.enabled = self.visibilityStatus == true
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -593,28 +593,18 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
||||
}
|
||||
}
|
||||
|
||||
let isPlaying = self.visibilityStatus && !self.forceStopAnimations
|
||||
if let animationNode = self.animationNode as? AnimatedStickerNode {
|
||||
if !isPlaying {
|
||||
for decorationNode in self.additionalAnimationNodes {
|
||||
if let transitionNode = item.controllerInteraction.getMessageTransitionNode() {
|
||||
decorationNode.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak decorationNode] _ in
|
||||
if let decorationNode = decorationNode {
|
||||
transitionNode.remove(decorationNode: decorationNode)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
self.additionalAnimationNodes.removeAll()
|
||||
|
||||
if let overlayMeshAnimationNode = self.overlayMeshAnimationNode {
|
||||
self.overlayMeshAnimationNode = nil
|
||||
if let transitionNode = item.controllerInteraction.getMessageTransitionNode() {
|
||||
transitionNode.remove(decorationNode: overlayMeshAnimationNode)
|
||||
}
|
||||
let isPlaying = self.visibilityStatus == true && !self.forceStopAnimations
|
||||
if !isPlaying {
|
||||
self.removeAdditionalAnimations()
|
||||
|
||||
if let overlayMeshAnimationNode = self.overlayMeshAnimationNode {
|
||||
self.overlayMeshAnimationNode = nil
|
||||
if let transitionNode = item.controllerInteraction.getMessageTransitionNode() {
|
||||
transitionNode.remove(decorationNode: overlayMeshAnimationNode)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if let animationNode = self.animationNode as? AnimatedStickerNode {
|
||||
if self.isPlaying != isPlaying {
|
||||
self.isPlaying = isPlaying
|
||||
|
||||
@ -1721,10 +1711,20 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
||||
|
||||
self.additionalAnimationNodes.append(decorationNode)
|
||||
|
||||
additionalAnimationNode.play()
|
||||
additionalAnimationNode.visibility = true
|
||||
}
|
||||
}
|
||||
|
||||
private func removeAdditionalAnimations() {
|
||||
for decorationNode in self.additionalAnimationNodes {
|
||||
if let additionalAnimationNode = decorationNode.contentView.asyncdisplaykit_node as? AnimatedStickerNode {
|
||||
additionalAnimationNode.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak additionalAnimationNode] _ in
|
||||
additionalAnimationNode?.visibility = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func gestureRecognized(gesture: TapLongTapOrDoubleTapGesture, location: CGPoint, recognizer: TapLongTapOrDoubleTapGestureRecognizer?) -> InternalBubbleTapAction? {
|
||||
switch gesture {
|
||||
case .tap:
|
||||
|
Loading…
x
Reference in New Issue
Block a user