Skip to content

Commit f143530

Browse files
committed
Various fixes
1 parent 6cfd465 commit f143530

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

‎submodules/GalleryUI/Sources/GalleryControllerNode.swift‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ open class GalleryControllerNode: ASDisplayNode, UIScrollViewDelegate, UIGesture
337337

338338
open func animateIn(animateContent: Bool, useSimpleAnimation: Bool) {
339339
let duration: Double = animateContent ? 0.2 : 0.3
340-
let fadeDuration: Double = 0.2
341340

342341
let backgroundColor = self.backgroundNode.backgroundColor ?? .black
343342

@@ -346,9 +345,9 @@ open class GalleryControllerNode: ASDisplayNode, UIScrollViewDelegate, UIGesture
346345
self.footerNode.alpha = 0.0
347346
self.currentThumbnailContainerNode?.alpha = 0.0
348347

349-
self.backgroundNode.layer.animate(from: backgroundColor.withAlphaComponent(0.0).cgColor, to: backgroundColor.cgColor, keyPath: "backgroundColor", timingFunction: CAMediaTimingFunctionName.linear.rawValue, duration: fadeDuration)
348+
self.backgroundNode.layer.animate(from: backgroundColor.withAlphaComponent(0.0).cgColor, to: backgroundColor.cgColor, keyPath: "backgroundColor", timingFunction: CAMediaTimingFunctionName.linear.rawValue, duration: 0.15)
350349

351-
UIView.animate(withDuration: fadeDuration, delay: 0.0, options: [.curveLinear], animations: {
350+
UIView.animate(withDuration: 0.15, delay: 0.0, options: [.curveLinear], animations: {
352351
if !self.areControlsHidden {
353352
self.statusBar?.alpha = 1.0
354353
self.navigationBar?.alpha = 1.0

‎submodules/GalleryUI/Sources/GalleryThumbnailContainerNode.swift‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,21 @@ public final class GalleryThumbnailContainerNode: ASDisplayNode, UIScrollViewDel
173173
self.scrollNode.view.contentSize = contentSize
174174
updated = true
175175
}
176+
177+
var progress = progress ?? 0.0
178+
if centralIndex == 0 && progress < 0.0 {
179+
progress = 0.0
180+
} else if centralIndex == self.itemNodes.count - 1 && progress > 0.0 {
181+
progress = 0.0
182+
}
183+
176184

177185
if updated || !self.isPanning {
178186
transition.animateView {
179187
self.scrollNode.view.contentOffset = self.contentOffsetToCenterItem(index: centralIndex, progress: progress, contentInset: contentInset)
180188
}
181189
}
182190

183-
let progress = progress ?? 0.0
184191
var itemFrames: [CGRect] = []
185192
var lastTrailingSpacing: CGFloat = 0.0
186193
var xOffset: CGFloat = -itemBaseSize.width / 2.0

‎submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
14191419

14201420
if isAnimated || disablePlayerControls {
14211421
strongSelf.footerContentNode.content = .info
1422-
} else if isPaused && !strongSelf.ignorePauseStatus {
1422+
} else if isPaused && !strongSelf.ignorePauseStatus && strongSelf.isCentral == true {
14231423
if hasStarted || strongSelf.didPause {
14241424
strongSelf.footerContentNode.content = .playback(paused: true, seekable: seekable)
14251425
} else if let fetchStatus = fetchStatus, !strongSelf.requiresDownload {
753 Bytes
Loading

0 commit comments

Comments
 (0)