Paid media improvements

This commit is contained in:
Ilya Laktyushin 2024-06-24 04:37:04 +04:00
parent e47b5a89ef
commit 6396a1ec80
2 changed files with 7 additions and 1 deletions

View File

@ -228,15 +228,19 @@ open class GalleryControllerNode: ASDisplayNode, ASScrollViewDelegate, ASGesture
fromLeft = true fromLeft = true
} }
if let current = strongSelf.currentThumbnailContainerNode { if let current = strongSelf.currentThumbnailContainerNode {
strongSelf.currentThumbnailContainerNode = nil
if thumbnailContainerVisible { if thumbnailContainerVisible {
current.animateOut(toRight: fromLeft) current.animateOut(toRight: fromLeft)
current.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak current] _ in current.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak current] _ in
current?.removeFromSupernode() current?.removeFromSupernode()
}) })
if let (navigationHeight, layout) = strongSelf.containerLayout, node == nil {
strongSelf.containerLayoutUpdated(layout, navigationBarHeight: navigationHeight, transition: .immediate)
}
} }
} }
strongSelf.currentThumbnailContainerNode = node
if let node = node { if let node = node {
strongSelf.currentThumbnailContainerNode = node
strongSelf.insertSubnode(node, aboveSubnode: strongSelf.footerNode) strongSelf.insertSubnode(node, aboveSubnode: strongSelf.footerNode)
if let (navigationHeight, layout) = strongSelf.containerLayout, thumbnailContainerVisible { if let (navigationHeight, layout) = strongSelf.containerLayout, thumbnailContainerVisible {
strongSelf.containerLayoutUpdated(layout, navigationBarHeight: navigationHeight, transition: .immediate) strongSelf.containerLayoutUpdated(layout, navigationBarHeight: navigationHeight, transition: .immediate)

View File

@ -54,6 +54,8 @@ public final class GalleryFooterNode: ASDisplayNode {
} }
self.addSubnode(footerContentNode) self.addSubnode(footerContentNode)
} }
} else if let _ = self.currentThumbnailPanelHeight {
self.currentThumbnailPanelHeight = thumbnailPanelHeight
} }
var animateOverlayIn = false var animateOverlayIn = false