Skip to content

armgit / ente

Public Imported from GitHub
0

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

Compact gallery video controls

ashilkn430d9b2a6104
diff --git a/mobile/apps/photos/changes/compact-video-controls.md b/mobile/apps/photos/changes/compact-video-controls.md
new file mode 100644
index 0000000000..202c08138d
--- /dev/null
+++ b/mobile/apps/photos/changes/compact-video-controls.md
@@ -0,0 +1 @@
+- Made video captions and playback controls more compact in the photo viewer.
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 f9a013bd45..7f021d0e0e 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/detail_page.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/detail_page.dart
@@ -39,7 +39,7 @@ import 'package:photos/ui/viewer/gallery/gallery.dart';
import 'package:photos/utils/dialog_util.dart';
const _socialRightInset = 24.0;
-const _socialBottomBarClearance = 154.0;
+const _socialBottomBarClearance = 130.0;
enum DetailPageMode { minimalistic, full }
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 f21bf10821..99856b2eb3 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
@@ -70,8 +70,8 @@ class _SeekBarState extends State<SeekBar> with SingleTickerProviderStateMixin {
data: SliderTheme.of(context).copyWith(
trackHeight: 1.0,
tickMarkShape: SliderTickMarkShape.noTickMark,
- thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 8.0),
- overlayShape: const RoundSliderOverlayShape(overlayRadius: 14.0),
+ thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 6.0),
+ overlayShape: const RoundSliderOverlayShape(overlayRadius: 12.0),
activeTrackColor: backgroundElevatedLight,
inactiveTrackColor: fillMutedDark,
thumbColor: backgroundElevatedLight,
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 05479e08c2..645b7a4f02 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
@@ -309,66 +309,64 @@ class SeekBarAndDuration extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final caption = file.caption;
+ final textStyle = getEnteTextTheme(
+ context,
+ ).mini.copyWith(color: textBaseDark);
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Container(
- padding: const EdgeInsets.fromLTRB(16, 4, 16, 4),
decoration: BoxDecoration(
color: Colors.black.withValues(alpha: 0.3),
borderRadius: const BorderRadius.all(Radius.circular(8)),
border: Border.all(color: strokeFaintDark, width: 1),
),
child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
- file.caption != null && file.caption!.isNotEmpty
- ? Padding(
- padding: const EdgeInsets.fromLTRB(0, 8, 0, 12),
- child: GestureDetector(
- onTap: () {
- showDetailsSheet(context, file);
- },
- child: Text(
- file.caption!,
- maxLines: 3,
- overflow: TextOverflow.ellipsis,
- style: getEnteTextTheme(
- context,
- ).mini.copyWith(color: textBaseDark),
+ if (caption != null && caption.isNotEmpty)
+ Padding(
+ padding: const EdgeInsets.fromLTRB(8, 4, 8, 4),
+ child: GestureDetector(
+ onTap: () => showDetailsSheet(context, file),
+ child: Row(
+ children: [
+ Text('"', style: textStyle),
+ Flexible(
+ child: Text(
+ caption,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: textStyle,
+ ),
),
- ),
- )
- : const SizedBox.shrink(),
- Row(
- children: [
- StreamBuilder(
- stream: controller?.player.stream.position,
- builder: (context, snapshot) {
- if (snapshot.data == null) {
- return Text(
- "0:00",
- style: getEnteTextTheme(
- context,
- ).mini.copyWith(color: textBaseDark),
- );
- }
- return Text(
- secondsToDuration(snapshot.data!.inSeconds),
- style: getEnteTextTheme(
- context,
- ).mini.copyWith(color: textBaseDark),
- );
- },
- ),
- Expanded(child: SeekBar(controller!, isSeekingNotifier)),
- Text(
- _secondsToDuration(
- controller!.player.state.duration.inSeconds,
+ Text('"', style: textStyle),
+ ],
),
- style: getEnteTextTheme(
- context,
- ).mini.copyWith(color: textBaseDark),
),
- ],
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Row(
+ children: [
+ StreamBuilder(
+ stream: controller?.player.stream.position,
+ builder: (context, snapshot) => Text(
+ snapshot.data == null
+ ? "0:00"
+ : secondsToDuration(snapshot.data!.inSeconds),
+ style: textStyle,
+ ),
+ ),
+ Expanded(child: SeekBar(controller!, isSeekingNotifier)),
+ Text(
+ _secondsToDuration(
+ controller!.player.state.duration.inSeconds,
+ ),
+ style: textStyle,
+ ),
+ ],
+ ),
),
],
),
@@ -443,8 +441,8 @@ class _SeekBarState extends State<SeekBar> {
return SliderTheme(
data: SliderTheme.of(context).copyWith(
trackHeight: 1.0,
- thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 8.0),
- overlayShape: const RoundSliderOverlayShape(overlayRadius: 14.0),
+ thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 6.0),
+ overlayShape: const RoundSliderOverlayShape(overlayRadius: 12.0),
activeTrackColor: backgroundElevatedLight,
inactiveTrackColor: fillMutedDark,
thumbColor: backgroundElevatedLight,
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 14e90c0736..bb67735689 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
@@ -877,6 +877,10 @@ class _SeekBarAndDuration extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final caption = file.caption;
+ final textStyle = getEnteTextTheme(
+ context,
+ ).mini.copyWith(color: textBaseDark);
return ValueListenableBuilder(
valueListenable: showControls,
builder: (BuildContext context, bool value, _) {
@@ -889,58 +893,57 @@ class _SeekBarAndDuration extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Container(
- padding: const EdgeInsets.fromLTRB(16, 4, 16, 4),
decoration: BoxDecoration(
color: Colors.black.withValues(alpha: 0.3),
borderRadius: const BorderRadius.all(Radius.circular(8)),
border: Border.all(color: strokeFaintDark, width: 1),
),
child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
- file.caption != null && file.caption!.isNotEmpty
- ? Padding(
- padding: const EdgeInsets.fromLTRB(0, 8, 0, 12),
- child: GestureDetector(
- onTap: () {
- showDetailsSheet(context, file);
- },
- child: Text(
- file.caption!,
- maxLines: 3,
- overflow: TextOverflow.ellipsis,
- style: getEnteTextTheme(
- context,
- ).mini.copyWith(color: textBaseDark),
+ if (caption != null && caption.isNotEmpty)
+ Padding(
+ padding: const EdgeInsets.fromLTRB(8, 4, 8, 4),
+ child: GestureDetector(
+ onTap: () => showDetailsSheet(context, file),
+ child: Row(
+ children: [
+ Text('"', style: textStyle),
+ Flexible(
+ child: Text(
+ caption,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: textStyle,
+ ),
),
- ),
- )
- : const SizedBox.shrink(),
- Row(
- children: [
- AnimatedSize(
- duration: const Duration(seconds: 5),
- curve: Curves.easeInOut,
- child: Text(
- secondsToDuration(position ~/ 1000),
- style: getEnteTextTheme(
- context,
- ).mini.copyWith(color: textBaseDark),
+ Text('"', style: textStyle),
+ ],
),
),
- Expanded(
- child: SeekBar(
- controller!,
- durationToSeconds(duration),
- isSeeking,
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Row(
+ children: [
+ AnimatedSize(
+ duration: const Duration(seconds: 5),
+ curve: Curves.easeInOut,
+ child: Text(
+ secondsToDuration(position ~/ 1000),
+ style: textStyle,
+ ),
),
- ),
- Text(
- duration ?? "0:00",
- style: getEnteTextTheme(
- context,
- ).mini.copyWith(color: textBaseDark),
- ),
- ],
+ Expanded(
+ child: SeekBar(
+ controller!,
+ durationToSeconds(duration),
+ isSeeking,
+ ),
+ ),
+ Text(duration ?? "0:00", style: textStyle),
+ ],
+ ),
),
],
),