Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Clarify file viewer control names

ashilkn995c37abd6d2
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 d249e7cff7..820c02a56f 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
@@ -773,7 +773,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
);
},
),
- _MemoryViewerOverlays(
+ _MemoryViewerScrimsAndCaption(
socialControlsVisible: _socialControlsVisible,
),
ValueListenableBuilder<int>(
@@ -1186,10 +1186,10 @@ class _MemoryDateChevronPainter extends CustomPainter {
bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
}
-class _MemoryViewerOverlays extends StatelessWidget {
+class _MemoryViewerScrimsAndCaption extends StatelessWidget {
final ValueListenable<bool> socialControlsVisible;
- const _MemoryViewerOverlays({required this.socialControlsVisible});
+ const _MemoryViewerScrimsAndCaption({required this.socialControlsVisible});
@override
Widget build(BuildContext context) {
diff --git a/mobile/apps/photos/lib/ui/viewer/file/detail_page.dart b/mobile/apps/photos/lib/ui/viewer/file/detail_page.dart
index 95719ffa1c..68845d7241 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/detail_page.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/detail_page.dart
@@ -320,7 +320,7 @@ class _BodyState extends State<_Body> {
).enableFullScreenNotifier;
return Stack(
children: [
- _GalleryBottomOverlay(
+ _GalleryFileViewerBottomOverlay(
file: file,
mode: widget.config.mode,
isGuestView: isGuestView,
@@ -687,13 +687,13 @@ class _BodyState extends State<_Body> {
}
}
-class _GalleryBottomOverlay extends StatelessWidget {
+class _GalleryFileViewerBottomOverlay extends StatelessWidget {
final EnteFile file;
final DetailPageMode mode;
final bool isGuestView;
final ValueListenable<bool> enableFullScreenNotifier;
- const _GalleryBottomOverlay({
+ const _GalleryFileViewerBottomOverlay({
required this.file,
required this.mode,
required this.isGuestView,
@@ -762,9 +762,9 @@ class _GalleryBottomOverlay extends StatelessWidget {
bottom:
safePadding.bottom +
(isVideo
- ? kGalleryVideoProgressBottom +
- kGalleryVideoProgressHeight +
- kGalleryVideoCaptionGap
+ ? kVideoProgressBottomInset +
+ kVideoProgressHeight +
+ kVideoCaptionGap
: _galleryBottomBarHeight + _galleryCaptionGap),
child: Align(
alignment: Alignment.centerLeft,
diff --git a/mobile/apps/photos/lib/ui/viewer/file/native_video_player_controls/seek_bar.dart b/mobile/apps/photos/lib/ui/viewer/file/native_video_player_controls/seek_bar.dart
index f64e7af33f..611337062f 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/native_video_player_controls/seek_bar.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/native_video_player_controls/seek_bar.dart
@@ -80,7 +80,7 @@ class _NativeVideoProgressControlsState
final seekBar = SliderTheme(
data: SliderTheme.of(context).copyWith(
trackHeight: 3.0,
- trackShape: const GalleryVideoSliderTrackShape(),
+ trackShape: const EqualHeightSliderTrackShape(),
tickMarkShape: SliderTickMarkShape.noTickMark,
thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 6.0),
overlayShape: const RoundSliderOverlayShape(overlayRadius: 12.0),
@@ -112,7 +112,7 @@ class _NativeVideoProgressControlsState
allowedInteraction: SliderInteraction.tapAndSlide,
),
);
- return GalleryVideoProgressRow(
+ return VideoProgressRow(
seekBar: seekBar,
elapsedTime: secondsToDuration(_elapsedMilliseconds ~/ 1000),
totalTime: secondsToDuration(
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 cef5afaf23..b1d6affdd7 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
@@ -3,16 +3,16 @@ import "package:photos/theme/colors.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/viewer/file/video_control/mute_button.dart";
-const kGalleryVideoProgressBottom = 64.0;
-const kGalleryVideoProgressHeight = 16.0;
-const kGalleryVideoProgressRowBottom = 56.0;
-const kGalleryVideoProgressRowHeight = 32.0;
-const kGalleryVideoCaptionGap = 6.0;
-const kGalleryVideoCaptionLineHeight = 16.0;
-const kGalleryVideoScrimTopPadding = 12.0;
+const kVideoProgressBottomInset = 64.0;
+const kVideoProgressHeight = 16.0;
+const kVideoProgressRowBottomInset = 56.0;
+const kVideoProgressRowHeight = 32.0;
+const kVideoCaptionGap = 6.0;
+const kVideoCaptionLineHeight = 16.0;
+const kVideoScrimTopPadding = 12.0;
-class GalleryVideoSliderTrackShape extends RoundedRectSliderTrackShape {
- const GalleryVideoSliderTrackShape();
+class EqualHeightSliderTrackShape extends RoundedRectSliderTrackShape {
+ const EqualHeightSliderTrackShape();
@override
void paint(
@@ -44,10 +44,10 @@ class GalleryVideoSliderTrackShape extends RoundedRectSliderTrackShape {
}
}
-class GalleryVideoControlScrim extends StatelessWidget {
+class VideoBottomScrim extends StatelessWidget {
final bool hasCaption;
- const GalleryVideoControlScrim({required this.hasCaption, super.key});
+ const VideoBottomScrim({required this.hasCaption, super.key});
@override
Widget build(BuildContext context) {
@@ -58,12 +58,10 @@ class GalleryVideoControlScrim extends StatelessWidget {
width: double.infinity,
height:
MediaQuery.paddingOf(context).bottom +
- kGalleryVideoProgressBottom +
- kGalleryVideoProgressHeight +
- (hasCaption
- ? kGalleryVideoCaptionGap + kGalleryVideoCaptionLineHeight
- : 0) +
- kGalleryVideoScrimTopPadding,
+ kVideoProgressBottomInset +
+ kVideoProgressHeight +
+ (hasCaption ? kVideoCaptionGap + kVideoCaptionLineHeight : 0) +
+ kVideoScrimTopPadding,
child: DecoratedBox(
decoration: BoxDecoration(
gradient: LinearGradient(
@@ -84,12 +82,12 @@ class GalleryVideoControlScrim extends StatelessWidget {
}
}
-class GalleryVideoProgressRow extends StatelessWidget {
+class VideoProgressRow extends StatelessWidget {
final Widget seekBar;
final String elapsedTime;
final String totalTime;
- const GalleryVideoProgressRow({
+ const VideoProgressRow({
required this.seekBar,
required this.elapsedTime,
required this.totalTime,
@@ -109,7 +107,7 @@ class GalleryVideoProgressRow extends StatelessWidget {
right: safePadding.right + 16,
),
child: SizedBox(
- height: kGalleryVideoProgressRowHeight,
+ height: kVideoProgressRowHeight,
child: Row(
children: [
Expanded(child: seekBar),
@@ -124,11 +122,9 @@ class GalleryVideoProgressRow extends StatelessWidget {
}
}
-double galleryVideoStreamControlBottom(bool hasCaption) {
- return kGalleryVideoProgressBottom +
- kGalleryVideoProgressHeight +
- (hasCaption
- ? kGalleryVideoCaptionGap + kGalleryVideoCaptionLineHeight
- : 0) +
+double videoStreamControlBottomInset(bool hasCaption) {
+ return kVideoProgressBottomInset +
+ kVideoProgressHeight +
+ (hasCaption ? kVideoCaptionGap + kVideoCaptionLineHeight : 0) +
8;
}
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 4d971c9c1a..d39a2d48ef 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
@@ -120,7 +120,7 @@ class _VideoWidgetState extends State<VideoWidget> {
alignment: Alignment.center,
children: [
if (!widget.isFromMemories)
- GalleryVideoControlScrim(
+ VideoBottomScrim(
hasCaption: widget.file.caption?.isNotEmpty ?? false,
),
GestureDetector(
@@ -172,7 +172,7 @@ class _VideoWidgetState extends State<VideoWidget> {
widget.isFromMemories
? const SizedBox.shrink()
: Positioned(
- bottom: kGalleryVideoProgressRowBottom,
+ bottom: kVideoProgressRowBottomInset,
right: 0,
left: 0,
child: IgnorePointer(
@@ -191,7 +191,7 @@ class _VideoWidgetState extends State<VideoWidget> {
widget.isFromMemories
? const SizedBox.shrink()
: Positioned(
- bottom: galleryVideoStreamControlBottom(
+ bottom: videoStreamControlBottomInset(
widget.file.caption?.isNotEmpty ?? false,
),
right: 0,
@@ -362,7 +362,7 @@ class _MediaKitVideoProgressControlsState
final seekBar = SliderTheme(
data: SliderTheme.of(context).copyWith(
trackHeight: 3.0,
- trackShape: const GalleryVideoSliderTrackShape(),
+ trackShape: const EqualHeightSliderTrackShape(),
tickMarkShape: SliderTickMarkShape.noTickMark,
thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 6.0),
overlayShape: const RoundSliderOverlayShape(overlayRadius: 12.0),
@@ -407,7 +407,7 @@ class _MediaKitVideoProgressControlsState
allowedInteraction: SliderInteraction.tapAndSlide,
),
);
- return GalleryVideoProgressRow(
+ return VideoProgressRow(
seekBar: seekBar,
elapsedTime: secondsToDuration(_elapsedTime.inSeconds),
totalTime: secondsToDuration(
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 b9c6e15392..c20e053710 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
@@ -351,7 +351,7 @@ class _VideoWidgetNativeState extends State<VideoWidgetNative>
child: child,
);
},
- child: GalleryVideoControlScrim(
+ child: VideoBottomScrim(
hasCaption:
widget.file.caption?.isNotEmpty ?? false,
),
@@ -417,7 +417,7 @@ class _VideoWidgetNativeState extends State<VideoWidgetNative>
widget.isFromMemories
? const SizedBox.shrink()
: Positioned(
- bottom: kGalleryVideoProgressRowBottom,
+ bottom: kVideoProgressRowBottomInset,
right: 0,
left: 0,
child: SafeArea(
@@ -437,7 +437,7 @@ class _VideoWidgetNativeState extends State<VideoWidgetNative>
widget.isFromMemories
? const SizedBox.shrink()
: Positioned(
- bottom: galleryVideoStreamControlBottom(
+ bottom: videoStreamControlBottomInset(
widget.file.caption?.isNotEmpty ?? false,
),
right: 0,