diff --git a/mobile/apps/photos/lib/ui/home/memories/full_screen_memory.dart b/mobile/apps/photos/lib/ui/home/memories/full_screen_memory.dart index 0fa74931a8..0486545723 100644 --- a/mobile/apps/photos/lib/ui/home/memories/full_screen_memory.dart +++ b/mobile/apps/photos/lib/ui/home/memories/full_screen_memory.dart @@ -153,6 +153,7 @@ class _FullScreenMemoryState extends State { /// Used to check if any pointer is on the screen. final hasPointerOnScreenNotifier = ValueNotifier(false); bool hasFinalFileLoaded = false; + bool isAtFirstOrLastFile = false; late final StreamSubscription _detailSheetEventSubscription; @@ -219,7 +220,7 @@ class _FullScreenMemoryState extends State { _progressAnimationController?.stop(); _zoomAnimationController?.stop(); } else { - if (hasFinalFileLoaded) { + if (hasFinalFileLoaded || isAtFirstOrLastFile) { _progressAnimationController?.forward(); _zoomAnimationController?.forward(); } @@ -237,6 +238,7 @@ class _FullScreenMemoryState extends State { void onFinalFileLoad(int duration) { hasFinalFileLoaded = true; + isAtFirstOrLastFile = false; if (_progressAnimationController?.isAnimating == true) { _progressAnimationController!.stop(); } @@ -260,6 +262,9 @@ class _FullScreenMemoryState extends State { _onPageChange(inheritedData, currentIndex + 1); } else if (widget.onNextMemory != null) { widget.onNextMemory!(); + } else { + isAtFirstOrLastFile = true; + _toggleAnimation(pause: false); } } @@ -271,10 +276,15 @@ class _FullScreenMemoryState extends State { _onPageChange(inheritedData, currentIndex - 1); } else if (widget.onPreviousMemory != null) { widget.onPreviousMemory!(); + } else { + isAtFirstOrLastFile = true; + _resetAnimation(); + _toggleAnimation(pause: false); } } void _onPageChange(FullScreenMemoryData inheritedData, int index) { + isAtFirstOrLastFile = false; unawaited( memoriesCacheService.markMemoryAsSeen( inheritedData.memories[index], @@ -709,6 +719,7 @@ class _MemoriesZoomWidgetState extends State duration: const Duration( seconds: 5, ), + animationBehavior: AnimationBehavior.preserve, ); final startScale = widget.zoomIn ? 1.05 : 1.15; diff --git a/mobile/apps/photos/lib/ui/home/memories/memory_progress_indicator.dart b/mobile/apps/photos/lib/ui/home/memories/memory_progress_indicator.dart index 0028215197..3cfc42253c 100644 --- a/mobile/apps/photos/lib/ui/home/memories/memory_progress_indicator.dart +++ b/mobile/apps/photos/lib/ui/home/memories/memory_progress_indicator.dart @@ -40,6 +40,7 @@ class _MemoryProgressIndicatorState extends State _animationController = AnimationController( vsync: this, duration: widget.duration, + animationBehavior: AnimationBehavior.preserve, ); _animation =