mirror of
https://github.com/immich-app/immich.git
synced 2025-01-04 02:46:47 +01:00
style(mobile): update video indicator (#4443)
This commit is contained in:
parent
8222327299
commit
18fcca2884
1 changed files with 34 additions and 20 deletions
|
@ -60,6 +60,39 @@ class ThumbnailImage extends StatelessWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget buildVideoIcon() {
|
||||||
|
final minutes = asset.duration.inMinutes;
|
||||||
|
final durationString = asset.duration.toString();
|
||||||
|
return Positioned(
|
||||||
|
top: 5,
|
||||||
|
right: 5,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
minutes > 59
|
||||||
|
? durationString.substring(0, 7) // h:mm:ss
|
||||||
|
: minutes > 0
|
||||||
|
? durationString.substring(2, 7) // mm:ss
|
||||||
|
: durationString.substring(3, 7), // m:ss
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 3,
|
||||||
|
),
|
||||||
|
const Icon(
|
||||||
|
Icons.play_circle_fill_rounded,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 18,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget buildImage() {
|
Widget buildImage() {
|
||||||
final image = SizedBox(
|
final image = SizedBox(
|
||||||
width: 300,
|
width: 300,
|
||||||
|
@ -162,26 +195,7 @@ class ThumbnailImage extends StatelessWidget {
|
||||||
size: 18,
|
size: 18,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (!asset.isImage)
|
if (!asset.isImage) buildVideoIcon(),
|
||||||
Positioned(
|
|
||||||
top: 5,
|
|
||||||
right: 5,
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
asset.duration.toString().substring(0, 7),
|
|
||||||
style: const TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 10,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Icon(
|
|
||||||
Icons.play_circle_outline_rounded,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue