Skip to content

armgit / ente

Public Imported from GitHub
0

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

Add isFromMemories parameter to handle gestures

AmanRajSinghMourya09199180f350
diff --git a/mobile/lib/ui/viewer/file/file_widget.dart b/mobile/lib/ui/viewer/file/file_widget.dart
index a38f576c37..e690d8f93f 100644
--- a/mobile/lib/ui/viewer/file/file_widget.dart
+++ b/mobile/lib/ui/viewer/file/file_widget.dart
@@ -12,6 +12,7 @@ class FileWidget extends StatelessWidget {
final Function(bool)? playbackCallback;
final BoxDecoration? backgroundDecoration;
final bool? autoPlay;
+ final bool? isFromMemories;
const FileWidget(
this.file, {
@@ -20,6 +21,7 @@ class FileWidget extends StatelessWidget {
this.playbackCallback,
required this.tagPrefix,
this.backgroundDecoration,
+ this.isFromMemories = false,
super.key,
});
@@ -37,6 +39,7 @@ class FileWidget extends StatelessWidget {
shouldDisableScroll: shouldDisableScroll,
tagPrefix: tagPrefix,
backgroundDecoration: backgroundDecoration,
+ isFromMemories: isFromMemories ?? false,
key: key ?? ValueKey(fileKey),
);
} else if (file.fileType == FileType.video) {
diff --git a/mobile/lib/ui/viewer/file/zoomable_live_image_new.dart b/mobile/lib/ui/viewer/file/zoomable_live_image_new.dart
index 65f05dbdd0..9c482b77fc 100644
--- a/mobile/lib/ui/viewer/file/zoomable_live_image_new.dart
+++ b/mobile/lib/ui/viewer/file/zoomable_live_image_new.dart
@@ -23,6 +23,7 @@ class ZoomableLiveImageNew extends StatefulWidget {
final Function(bool)? shouldDisableScroll;
final String? tagPrefix;
final Decoration? backgroundDecoration;
+ final bool isFromMemories;
const ZoomableLiveImageNew(
this.enteFile, {
@@ -30,6 +31,7 @@ class ZoomableLiveImageNew extends StatefulWidget {
this.shouldDisableScroll,
required this.tagPrefix,
this.backgroundDecoration,
+ this.isFromMemories = false,
});
@override
@@ -96,12 +98,15 @@ class _ZoomableLiveImageNewState extends State<ZoomableLiveImageNew>
isGuestView: isGuestView,
);
}
+ if (!widget.isFromMemories) {
return GestureDetector(
- onLongPressStart: (_) => {_onLongPressEvent(true)},
- onLongPressEnd: (_) => {_onLongPressEvent(false)},
+ onLongPressStart: (_) => _onLongPressEvent(true),
+ onLongPressEnd: (_) => _onLongPressEvent(false),
child: content,
);
}
+ return content;
+ }
@override
void dispose() {