Shared media improvements

This commit is contained in:
Ali
2021-10-28 22:11:20 +04:00
parent 6f082b3e93
commit e7df73303c
6 changed files with 327 additions and 34 deletions

View File

@@ -809,6 +809,10 @@ public final class SparseItemGrid: ASDisplayNode {
self.decelerationAnimator?.isPaused = false
}
func updateShimmerColors() {
self.updateVisibleItems(resetScrolling: false, synchronous: .none, restoreScrollPosition: nil)
}
private func updateVisibleItems(resetScrolling: Bool, synchronous: SparseItemGrid.Synchronous, restoreScrollPosition: (y: CGFloat, index: Int)?) {
guard let layout = self.layout, let items = self.items else {
return
@@ -1695,4 +1699,12 @@ public final class SparseItemGrid: ASDisplayNode {
public func transferVelocity(_ velocity: CGFloat) {
self.currentViewport?.transferVelocity(velocity)
}
public func updatePresentationData(theme: PresentationTheme) {
self.theme = theme
if let currentViewport = self.currentViewport {
currentViewport.updateShimmerColors()
}
}
}