Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] adjust the 2x pill indicator position

aaqil29182d063192
diff --git a/mobile/apps/photos/lib/ui/viewer/file/video_control/gallery_video_controls.dart b/mobile/apps/photos/lib/ui/viewer/file/video_control/gallery_video_controls.dart
index 659c8c06e1..4982eb7fcd 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/video_control/gallery_video_controls.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/video_control/gallery_video_controls.dart
@@ -12,6 +12,13 @@ const kVideoCaptionLineHeight = 16.0;
const kVideoScrimTopPadding = 12.0;
const kVideoLongPressPlaybackSpeed = 2.0;
+double videoLongPressSpeedIndicatorTop(BuildContext context) {
+ final screenSize = MediaQuery.sizeOf(context);
+ final isLandscape = screenSize.width > screenSize.height;
+ return MediaQuery.paddingOf(context).top +
+ (isLandscape ? 8 : kToolbarHeight + 16);
+}
+
class VideoLongPressSpeedIndicator extends StatelessWidget {
const VideoLongPressSpeedIndicator({super.key});
diff --git a/mobile/apps/photos/lib/ui/viewer/file/video_widget_media_kit_common.dart b/mobile/apps/photos/lib/ui/viewer/file/video_widget_media_kit_common.dart
index 80f28b3a56..b48c4b3290 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/video_widget_media_kit_common.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/video_widget_media_kit_common.dart
@@ -242,7 +242,7 @@ class _VideoWidgetState extends State<VideoWidget> {
),
if (_isLongPressSpeedActive)
Positioned(
- top: MediaQuery.paddingOf(context).top + kToolbarHeight + 16,
+ top: videoLongPressSpeedIndicatorTop(context),
left: 0,
right: 0,
child: const Center(child: VideoLongPressSpeedIndicator()),
diff --git a/mobile/apps/photos/lib/ui/viewer/file/video_widget_native.dart b/mobile/apps/photos/lib/ui/viewer/file/video_widget_native.dart
index dd0e21af52..b640227402 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/video_widget_native.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/video_widget_native.dart
@@ -436,10 +436,7 @@ class _VideoWidgetNativeState extends State<VideoWidgetNative>
),
if (_isLongPressSpeedActive)
Positioned(
- top:
- MediaQuery.paddingOf(context).top +
- kToolbarHeight +
- 16,
+ top: videoLongPressSpeedIndicatorTop(context),
left: 0,
right: 0,
child: const Center(