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 {
|
if progress == 1.0 {
|
||||||
for itemNode in temporaryPreviousNodes {
|
for itemNode in temporaryPreviousNodes {
|
||||||
|
itemNode.visibility = .none
|
||||||
itemNode.removeFromSupernode()
|
itemNode.removeFromSupernode()
|
||||||
itemNode.extractedBackgroundNode?.removeFromSupernode()
|
itemNode.extractedBackgroundNode?.removeFromSupernode()
|
||||||
}
|
}
|
||||||
@ -3360,6 +3361,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
|||||||
} else {
|
} else {
|
||||||
animation.completion = { _ in
|
animation.completion = { _ in
|
||||||
for itemNode in temporaryPreviousNodes {
|
for itemNode in temporaryPreviousNodes {
|
||||||
|
itemNode.visibility = .none
|
||||||
itemNode.removeFromSupernode()
|
itemNode.removeFromSupernode()
|
||||||
itemNode.extractedBackgroundNode?.removeFromSupernode()
|
itemNode.extractedBackgroundNode?.removeFromSupernode()
|
||||||
}
|
}
|
||||||
@ -3442,6 +3444,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
|||||||
private func removeItemNodeAtIndex(_ index: Int) {
|
private func removeItemNodeAtIndex(_ index: Int) {
|
||||||
let node = self.itemNodes[index]
|
let node = self.itemNodes[index]
|
||||||
self.itemNodes.remove(at: index)
|
self.itemNodes.remove(at: index)
|
||||||
|
node.visibility = .none
|
||||||
node.removeFromSupernode()
|
node.removeFromSupernode()
|
||||||
node.extractedBackgroundNode?.removeFromSupernode()
|
node.extractedBackgroundNode?.removeFromSupernode()
|
||||||
node.accessoryItemNode?.removeFromSupernode()
|
node.accessoryItemNode?.removeFromSupernode()
|
||||||
|
@ -402,11 +402,11 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var visibilityStatus: Bool = false {
|
private var visibilityStatus: Bool? {
|
||||||
didSet {
|
didSet {
|
||||||
if self.visibilityStatus != oldValue {
|
if self.visibilityStatus != oldValue {
|
||||||
self.updateVisibility()
|
self.updateVisibility()
|
||||||
self.haptic?.enabled = self.visibilityStatus
|
self.haptic?.enabled = self.visibilityStatus == true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -593,19 +593,9 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let isPlaying = self.visibilityStatus && !self.forceStopAnimations
|
let isPlaying = self.visibilityStatus == true && !self.forceStopAnimations
|
||||||
if let animationNode = self.animationNode as? AnimatedStickerNode {
|
|
||||||
if !isPlaying {
|
if !isPlaying {
|
||||||
for decorationNode in self.additionalAnimationNodes {
|
self.removeAdditionalAnimations()
|
||||||
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 {
|
if let overlayMeshAnimationNode = self.overlayMeshAnimationNode {
|
||||||
self.overlayMeshAnimationNode = nil
|
self.overlayMeshAnimationNode = nil
|
||||||
@ -614,7 +604,7 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if let animationNode = self.animationNode as? AnimatedStickerNode {
|
||||||
if self.isPlaying != isPlaying {
|
if self.isPlaying != isPlaying {
|
||||||
self.isPlaying = isPlaying
|
self.isPlaying = isPlaying
|
||||||
|
|
||||||
@ -1721,7 +1711,17 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
|
|
||||||
self.additionalAnimationNodes.append(decorationNode)
|
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
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user