mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix reaction list fade in
This commit is contained in:
parent
b8527180d7
commit
0be460b147
@ -459,6 +459,7 @@ public final class ReactionListContextMenuContent: ContextControllerItemsContent
|
||||
|
||||
private let scrollNode: ASScrollNode
|
||||
private var ignoreScrolling: Bool = false
|
||||
private var animateIn: Bool = false
|
||||
|
||||
private var presentationData: PresentationData?
|
||||
private var currentSize: CGSize?
|
||||
@ -520,6 +521,7 @@ public final class ReactionListContextMenuContent: ContextControllerItemsContent
|
||||
animateIn = true
|
||||
}
|
||||
strongSelf.state = updatedState
|
||||
strongSelf.animateIn = true
|
||||
strongSelf.requestUpdate(strongSelf, animateIn ? .animated(duration: 0.2, curve: .easeInOut) : .immediate)
|
||||
if animateIn {
|
||||
for (_, itemNode) in strongSelf.itemNodes {
|
||||
@ -624,7 +626,7 @@ public final class ReactionListContextMenuContent: ContextControllerItemsContent
|
||||
for (id, placeholderLayer) in self.placeholderLayers {
|
||||
if !validPlaceholderIds.contains(id) {
|
||||
removePlaceholderIds.append(id)
|
||||
if animated {
|
||||
if animated || self.animateIn {
|
||||
placeholderLayer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak placeholderLayer] _ in
|
||||
placeholderLayer?.removeFromSuperlayer()
|
||||
})
|
||||
@ -698,6 +700,8 @@ public final class ReactionListContextMenuContent: ContextControllerItemsContent
|
||||
|
||||
self.updateVisibleItems(animated: transition.isAnimated, syncronousLoad: !transition.isAnimated)
|
||||
|
||||
self.animateIn = false
|
||||
|
||||
var apparentHeight = -self.scrollNode.view.contentOffset.y + self.scrollNode.view.contentSize.height
|
||||
apparentHeight = max(apparentHeight, 44.0)
|
||||
apparentHeight = min(apparentHeight, containerSize.height + 100.0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user