diff --git a/lib/models/collection.dart b/lib/models/collection.dart index ae9cf6ab6..892ccdfbb 100644 --- a/lib/models/collection.dart +++ b/lib/models/collection.dart @@ -81,6 +81,8 @@ class Collection { return (owner?.id ?? 0) == userID; } + String get collectionName => name ?? "Unnamed collection"; + void updateSharees(List newSharees) { sharees?.clear(); sharees?.addAll(newSharees); diff --git a/lib/ui/components/album_list_item_widget.dart b/lib/ui/components/album_list_item_widget.dart index c2ad28d82..d588b2743 100644 --- a/lib/ui/components/album_list_item_widget.dart +++ b/lib/ui/components/album_list_item_widget.dart @@ -15,65 +15,80 @@ class AlbumListItemWidget extends StatelessWidget { final logger = Logger("AlbumListItemWidget"); final textTheme = getEnteTextTheme(context); final colorScheme = getEnteColorScheme(context); - return Container( - decoration: BoxDecoration( - border: Border.all(color: colorScheme.strokeFainter), - borderRadius: BorderRadius.circular(4), - ), - child: ClipRRect( - borderRadius: const BorderRadius.all( - Radius.circular(4), - ), - child: Row( + const sideOfThumbnail = 60.0; + return Stack( + children: [ + Row( children: [ - SizedBox( - height: 60, - width: 60, - key: Key("collection_item:" + (item.thumbnail?.tag ?? "")), - child: item.thumbnail != null - ? ThumbnailWidget( - item.thumbnail, - showFavForAlbumOnly: true, - ) - : const NoThumbnailWidget(), + ClipRRect( + borderRadius: const BorderRadius.horizontal( + left: Radius.circular(4), + ), + child: SizedBox( + height: sideOfThumbnail, + width: sideOfThumbnail, + key: Key("collection_item:" + (item.thumbnail?.tag ?? "")), + child: item.thumbnail != null + ? ThumbnailWidget( + item.thumbnail, + showFavForAlbumOnly: true, + ) + : const NoThumbnailWidget(), + ), ), - const SizedBox(width: 12), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(item.collection.collectionName), - FutureBuilder( - future: - FilesDB.instance.collectionFileCount(item.collection.id), - builder: (context, snapshot) { - if (snapshot.hasData) { - final text = snapshot.data == 1 ? " memory" : " memories"; - return Text( - snapshot.data.toString() + text, - style: textTheme.small.copyWith( - color: colorScheme.textMuted, - ), - ); - } else { - if (snapshot.hasError) { - logger.severe( - "Failed to fetch file count of collection id ${item.collection.id}", + Padding( + padding: const EdgeInsets.only(left: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(item.collection.collectionName), + FutureBuilder( + future: FilesDB.instance + .collectionFileCount(item.collection.id), + builder: (context, snapshot) { + if (snapshot.hasData) { + final text = + snapshot.data == 1 ? " memory" : " memories"; + return Text( + snapshot.data.toString() + text, + style: textTheme.small.copyWith( + color: colorScheme.textMuted, + ), + ); + } else { + if (snapshot.hasError) { + logger.severe( + "Failed to fetch file count of collection id ${item.collection.id}", + ); + } + return Text( + "", + style: textTheme.small.copyWith( + color: colorScheme.textMuted, + ), ); } - return Text( - "", - style: textTheme.small.copyWith( - color: colorScheme.textMuted, - ), - ); - } - }, - ), - ], + }, + ), + ], + ), ), ], ), - ), + IgnorePointer( + child: Container( + height: sideOfThumbnail, + //32 is to account for padding of 16pts on both sides + width: MediaQuery.of(context).size.width - 32, + decoration: BoxDecoration( + border: Border.all(color: colorScheme.strokeFainter), + borderRadius: const BorderRadius.all( + Radius.circular(4), + ), + ), + ), + ), + ], ); } } diff --git a/lib/ui/create_collection_sheet.dart b/lib/ui/create_collection_sheet.dart index da89ef107..a7770e8fe 100644 --- a/lib/ui/create_collection_sheet.dart +++ b/lib/ui/create_collection_sheet.dart @@ -10,6 +10,8 @@ import 'package:photos/models/selected_files.dart'; import 'package:photos/services/collections_service.dart'; import 'package:photos/services/ignored_files_service.dart'; import 'package:photos/services/remote_sync_service.dart'; +import 'package:photos/theme/colors.dart'; +import 'package:photos/theme/ente_theme.dart'; import 'package:photos/ui/common/loading_widget.dart'; import 'package:photos/ui/components/album_list_item_widget.dart'; import 'package:photos/ui/components/bottom_of_title_bar_widget.dart'; @@ -68,6 +70,8 @@ void createCollectionSheet( ), ), topControl: const SizedBox.shrink(), + backgroundColor: getEnteColorScheme(context).backgroundElevated, + barrierColor: backdropFaintDark, ); }