mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Fix snapshotting
This commit is contained in:
@@ -2435,17 +2435,22 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
}
|
||||
|
||||
if node.index == nil {
|
||||
var duration = insertionAnimationDuration
|
||||
if let value = self.customItemDeleteAnimationDuration(itemNode: node) {
|
||||
duration = value
|
||||
}
|
||||
|
||||
if node.animationForKey("height") == nil || !(node is ListViewTempItemNode) {
|
||||
node.addHeightAnimation(0.0, duration: insertionAnimationDuration * UIView.animationDurationFactor(), beginAt: timestamp)
|
||||
node.addHeightAnimation(0.0, duration: duration * UIView.animationDurationFactor(), beginAt: timestamp)
|
||||
}
|
||||
if node.animationForKey("apparentHeight") == nil || !(node is ListViewTempItemNode) {
|
||||
node.addApparentHeightAnimation(0.0, duration: insertionAnimationDuration * UIView.animationDurationFactor(), beginAt: timestamp, update: { [weak node] progress, currentValue in
|
||||
node.addApparentHeightAnimation(0.0, duration: duration * UIView.animationDurationFactor(), beginAt: timestamp, update: { [weak node] progress, currentValue in
|
||||
if let node = node {
|
||||
node.animateFrameTransition(progress, currentValue)
|
||||
}
|
||||
})
|
||||
}
|
||||
node.animateRemoved(timestamp, duration: insertionAnimationDuration * UIView.animationDurationFactor())
|
||||
node.animateRemoved(timestamp, duration: duration * UIView.animationDurationFactor())
|
||||
} else if animated {
|
||||
if takenAnimation {
|
||||
if let previousFrame = previousFrame {
|
||||
@@ -5041,6 +5046,10 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
}
|
||||
return self.scrollWithDirection(scrollDirection, distance: distance)
|
||||
}
|
||||
|
||||
open func customItemDeleteAnimationDuration(itemNode: ListViewItemNode) -> Double? {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
private func findAccessibilityFocus(_ node: ASDisplayNode) -> Bool {
|
||||
|
||||
Reference in New Issue
Block a user