Skip to content

armgit / ente

Public Imported from GitHub
0

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

Improve swipe to select UX

ashilkn462f7d9b983c
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
index 9e5846c99a..ed2725655e 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
@@ -598,10 +598,10 @@ class GalleryState extends State<Gallery> {
if (!_swipeActiveNotifier.value &&
widget.selectedFiles != null &&
widget.selectedFiles!.files.isNotEmpty) {
- // Check if movement is primarily horizontal (2x more than vertical) and if delta x is significant
+ // Check if movement is primarily horizontal and if delta x is significant
final dx = event.delta.dx.abs();
final dy = event.delta.dy.abs();
- if (dx > dy * 2 && dx > 0.1) {
+ if (dx > dy && dx > 0.1) {
// Horizontal swipe detected, activate swipe mode
_swipeActiveNotifier.value = true;
}
@@ -614,7 +614,7 @@ class GalleryState extends State<Gallery> {
// Check if this is horizontal movement when only one file is selected
final dx = event.delta.dx.abs();
final dy = event.delta.dy.abs();
- if (dx > dy * 2 && dx > 0.1) {
+ if (dx > dy && dx > 0.1) {
_swipeActiveNotifier.value = true;
}
}