Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix reseting progress bar to full before starting new memory & improve paly/pause for video memory

AmanRajSinghMourya629d9027451e
diff --git a/mobile/lib/ui/home/memories/full_screen_memory.dart b/mobile/lib/ui/home/memories/full_screen_memory.dart
index b5ac901855..cfdb139251 100644
--- a/mobile/lib/ui/home/memories/full_screen_memory.dart
+++ b/mobile/lib/ui/home/memories/full_screen_memory.dart
@@ -178,6 +178,15 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
}
}
+ void _resetAnimation() {
+ _progressAnimationController
+ ?..stop()
+ ..reset();
+ _zoomAnimationController
+ ?..stop()
+ ..reset();
+ }
+
void onFinalFileLoad(int duration) {
if (_progressAnimationController!.isAnimating == true) {
_progressAnimationController!.stop();
@@ -328,10 +337,10 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
}
},
onLongPress: () {
- _toggleAnimation(true);
+ isVideo ? null: _toggleAnimation(true);
},
onLongPressUp: () {
- _toggleAnimation(false);
+ isVideo ? null : _toggleAnimation(false);
},
child: MemoriesZoomWidget(
scaleController: (controller) {
@@ -348,9 +357,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
),
isFromMemories: true,
playbackCallback: (isPlaying) {
- isPlaying
- ? _toggleAnimation(false)
- : _toggleAnimation(true);
+ _toggleAnimation(!isPlaying);
},
onFinalFileLoad: ({required int memoryDuration}) {
onFinalFileLoad(memoryDuration);
@@ -367,6 +374,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
),
);
inheritedData.indexNotifier.value = index;
+ _resetAnimation();
},
itemCount: inheritedData.memories.length,
),
diff --git a/mobile/lib/ui/viewer/file/video_widget_media_kit_common.dart b/mobile/lib/ui/viewer/file/video_widget_media_kit_common.dart
index 34234e2259..2e50e0adc0 100644
--- a/mobile/lib/ui/viewer/file/video_widget_media_kit_common.dart
+++ b/mobile/lib/ui/viewer/file/video_widget_media_kit_common.dart
@@ -110,11 +110,13 @@ class _VideoWidgetState extends State<VideoWidget> {
},
onLongPress: () {
if (widget.isFromMemories) {
+ widget.playbackCallback?.call(false);
widget.controller.player.stop();
}
},
onLongPressUp: () {
if (widget.isFromMemories) {
+ widget.playbackCallback?.call(true);
widget.controller.player.play();
}
},
diff --git a/mobile/lib/ui/viewer/file/video_widget_native.dart b/mobile/lib/ui/viewer/file/video_widget_native.dart
index a37151ed6d..741077e12a 100644
--- a/mobile/lib/ui/viewer/file/video_widget_native.dart
+++ b/mobile/lib/ui/viewer/file/video_widget_native.dart
@@ -294,11 +294,13 @@ class _VideoWidgetNativeState extends State<VideoWidgetNative>
},
onLongPress: () {
if (widget.isFromMemories) {
+ widget.playbackCallback?.call(false);
_controller?.pause();
}
},
onLongPressUp: () {
if (widget.isFromMemories) {
+ widget.playbackCallback?.call(true);
_controller?.play();
}
},