mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
feat: show motion photo icon on mobile timeline tile (#22454)
* feat: show motion photo icon on timeline tile * chore: switch to private widget for asset type icons * chore: small cleanup on asset type icons widget
This commit is contained in:
parent
8de7eed940
commit
df469cc412
1 changed files with 33 additions and 15 deletions
|
|
@ -54,8 +54,6 @@ class ThumbnailTile extends ConsumerWidget {
|
|||
)
|
||||
: const BoxDecoration();
|
||||
|
||||
final hasStack = asset is RemoteAsset && asset.stackId != null;
|
||||
|
||||
final bool storageIndicator =
|
||||
showStorageIndicator ?? ref.watch(settingsProvider.select((s) => s.get(Setting.showStorageIndicator)));
|
||||
|
||||
|
|
@ -77,21 +75,10 @@ class ThumbnailTile extends ConsumerWidget {
|
|||
child: Thumbnail.fromAsset(asset: asset, size: size),
|
||||
),
|
||||
),
|
||||
if (hasStack)
|
||||
if (asset != null)
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(right: 10.0, top: asset.isVideo ? 24.0 : 6.0),
|
||||
child: const _TileOverlayIcon(Icons.burst_mode_rounded),
|
||||
),
|
||||
),
|
||||
if (asset != null && asset.isVideo)
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: 10.0, top: 6.0),
|
||||
child: _VideoIndicator(asset.duration),
|
||||
),
|
||||
child: _AssetTypeIcons(asset: asset),
|
||||
),
|
||||
if (storageIndicator && asset != null)
|
||||
switch (asset.storage) {
|
||||
|
|
@ -214,3 +201,34 @@ class _TileOverlayIcon extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _AssetTypeIcons extends StatelessWidget {
|
||||
final BaseAsset asset;
|
||||
|
||||
const _AssetTypeIcons({required this.asset});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final hasStack = asset is RemoteAsset && (asset as RemoteAsset).stackId != null;
|
||||
final isLivePhoto = asset is RemoteAsset && asset.livePhotoVideoId != null;
|
||||
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
if (asset.isVideo)
|
||||
Padding(padding: const EdgeInsets.only(right: 10.0, top: 6.0), child: _VideoIndicator(asset.duration)),
|
||||
if (hasStack)
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(right: 10.0, top: 6.0),
|
||||
child: _TileOverlayIcon(Icons.burst_mode_rounded),
|
||||
),
|
||||
if (isLivePhoto)
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(right: 10.0, top: 6.0),
|
||||
child: _TileOverlayIcon(Icons.motion_photos_on_rounded),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue