Skip to content

armgit / ente

Public Imported from GitHub
0

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

Merge branch 'main' into album

AmanRajSinghMourya6b6f9f7cffdc
diff --cc mobile/apps/photos/lib/ui/collections/album/list_item.dart
index b8596c1cf2,c75f718a2f..e9274fadea
--- a/mobile/apps/photos/lib/ui/collections/album/list_item.dart
+++ b/mobile/apps/photos/lib/ui/collections/album/list_item.dart
@@@ -16,14 -16,8 +16,8 @@@ import "package:photos/ui/viewer/file/n
import "package:photos/ui/viewer/file/thumbnail_widget.dart";
class AlbumListItemWidget extends StatelessWidget {
- static const _thumbSize = 52.0;
- static const _cornerRadius = 12.0;
- static const _rowHeight = 68.0;
- static const _cardRadius = 20.0;
- static const _padding = 8.0;
-
static final double _trailingWidth =
- getAvatarSize(AvatarType.md) + getOverlapPadding(AvatarType.md);
+ getAvatarSize(AvatarType.medium) + getOverlapPadding(AvatarType.medium);
final Collection collection;
final void Function(Collection)? onTapCallback;
@@@ -217,6 -138,32 +138,32 @@@
);
},
),
+ trailing: Padding(
+ padding: const EdgeInsets.only(right: 8),
+ child: SizedBox(
+ width: _trailingWidth,
- height: getAvatarSize(AvatarType.md),
++ height: getAvatarSize(AvatarType.medium),
+ child: AnimatedSwitcher(
+ duration: const Duration(milliseconds: 300),
+ switchInCurve: Curves.easeOut,
+ switchOutCurve: Curves.easeIn,
+ layoutBuilder: (currentChild, previousChildren) {
+ return Stack(
+ alignment: Alignment.centerRight,
+ children: [
+ ...previousChildren,
+ if (currentChild != null) currentChild,
+ ],
+ );
+ },
+ child: _buildTrailingIndicator(
+ context,
+ isSelected: isSelected,
+ isOwner: isOwner,
+ ),
+ ),
+ ),
+ ),
);
}
@@@ -224,11 -172,11 +172,11 @@@
required bool isSelected,
required bool isOwner,
}) {
- final double avatarSize = getAvatarSize(AvatarType.md);
- final double slotOverlap = getOverlapPadding(AvatarType.md);
+ final double avatarSize = getAvatarSize(AvatarType.medium);
+ final double slotOverlap = getOverlapPadding(AvatarType.medium);
if (isSelected) {
- return const CollectionSelectedBadge(
+ return const _CollectionSelectedBadge(
key: ValueKey("selected"),
);
}
@@@ -263,3 -211,106 +211,106 @@@
return const SizedBox.shrink(key: ValueKey("unselected"));
}
}
+
+ class _AlbumListItemCover extends StatelessWidget {
+ final Collection collection;
+ final bool showSharingIndicator;
+ final bool isOutgoing;
+
+ const _AlbumListItemCover({
+ required this.collection,
+ required this.showSharingIndicator,
+ required this.isOutgoing,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ return Stack(
+ clipBehavior: Clip.none,
+ children: [
+ ClipRRect(
+ borderRadius: BorderRadius.circular(
+ ThumbnailListItem.defaultLeadingRadius,
+ ),
+ child: SizedBox.expand(
+ child: FutureBuilder<EnteFile?>(
+ future: CollectionsService.instance.getCover(collection),
+ builder: (context, snapshot) {
+ if (snapshot.hasData) {
+ return ThumbnailWidget(
+ snapshot.data!,
+ shouldShowFavoriteIcon: false,
+ shouldShowOwnerAvatar: false,
+ );
+ }
+ return const NoThumbnailWidget(
+ borderRadius: ThumbnailListItem.defaultLeadingRadius,
+ addBorder: false,
+ );
+ },
+ ),
+ ),
+ ),
+ if (showSharingIndicator)
+ Positioned(
+ right: -4,
+ bottom: -4,
+ child: _CollectionShareBadge(isOutgoing: isOutgoing),
+ ),
+ ],
+ );
+ }
+ }
+
+ class _CollectionShareBadge extends StatelessWidget {
+ final bool isOutgoing;
+
+ const _CollectionShareBadge({
+ required this.isOutgoing,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ final colorScheme = getEnteColorScheme(context);
+ return Container(
+ width: 20,
+ height: 20,
+ decoration: BoxDecoration(
+ color: colorScheme.backgroundElevated,
+ shape: BoxShape.circle,
+ border: Border.all(color: colorScheme.strokeFainter),
+ ),
+ child: Center(
+ child: Icon(
+ isOutgoing
+ ? Icons.person_add_alt_1_outlined
+ : Icons.person_outline_rounded,
+ size: 12,
+ color: colorScheme.textMuted,
+ ),
+ ),
+ );
+ }
+ }
+
+ class _CollectionSelectedBadge extends StatelessWidget {
+ const _CollectionSelectedBadge({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ final colorScheme = getEnteColorScheme(context);
+ return Container(
- width: getAvatarSize(AvatarType.md),
- height: getAvatarSize(AvatarType.md),
++ width: getAvatarSize(AvatarType.medium),
++ height: getAvatarSize(AvatarType.medium),
+ decoration: BoxDecoration(
+ color: colorScheme.greenBase,
+ shape: BoxShape.circle,
+ ),
+ child: const Icon(
+ Icons.check_rounded,
+ size: 16,
+ color: Colors.white,
+ ),
+ );
+ }
+ }
diff --cc mobile/apps/photos/lib/ui/collections/album/new_list_item.dart
index a37fad59e6,9cb9278b8c..995f194d63
--- a/mobile/apps/photos/lib/ui/collections/album/new_list_item.dart
+++ b/mobile/apps/photos/lib/ui/collections/album/new_list_item.dart
@@@ -1,25 -1,13 +1,14 @@@
- import "package:ente_pure_utils/ente_pure_utils.dart";
import 'package:flutter/material.dart';
- import "package:logging/logging.dart";
import "package:photos/generated/l10n.dart";
- import 'package:photos/models/collection/collection.dart';
- import 'package:photos/models/collection/collection_items.dart';
- import "package:photos/services/collections_service.dart";
--import 'package:photos/theme/ente_theme.dart';
- import "package:photos/ui/viewer/gallery/collection_page.dart";
- import "package:photos/utils/dialog_util.dart";
++import "package:photos/theme/ente_theme.dart";
+ import "package:photos/ui/components/thumbnail_list_item.dart";
-//https://www.figma.com/design/SYtMyLBs5SAOkTbfMMzhqt/Ente-Visual-Design?node-id=39181-172209&t=3qmSZWpXF3ZC4JGN-1
-
class NewAlbumListItemWidget extends StatelessWidget {
- static const _rowHeight = 68.0;
- static const _cardRadius = 20.0;
- static const _thumbnailSize = 52.0;
- static const _thumbnailRadius = 12.0;
-
+ final Future<void> Function(BuildContext context)? onTap;
+
const NewAlbumListItemWidget({
super.key,
+ this.onTap,
});
@override
diff --cc mobile/apps/photos/lib/ui/settings/search/settings_search_page.dart
index e9360a45c6,db24262956..35110baab2
--- a/mobile/apps/photos/lib/ui/settings/search/settings_search_page.dart
+++ b/mobile/apps/photos/lib/ui/settings/search/settings_search_page.dart
@@@ -73,8 -71,8 +71,8 @@@ class _SettingsSearchPageState extends
final sectionKey = _sectionKey(item.sectionPath);
final intraSectionOrder =
sectionKey == l10n.freeUpSpace && freeUpSpacePriority.isNotEmpty
-- ? (freeUpSpacePriority[item.title] ?? 100 + i)
-- : i;
++ ? (freeUpSpacePriority[item.title] ?? 100 + i)
++ : i;
entries.add(
_SearchResultEntry(
item: item,
@@@ -103,13 -101,13 +101,15 @@@
.toList();
filteredEntries.sort((a, b) {
-- final matchPriority = _matchPriority(a.matchType)
-- .compareTo(_matchPriority(b.matchType));
++ final matchPriority = _matchPriority(
++ a.matchType,
++ ).compareTo(_matchPriority(b.matchType));
if (matchPriority != 0) return matchPriority;
final sectionPriority = a.sectionOrder.compareTo(b.sectionOrder);
if (sectionPriority != 0) return sectionPriority;
-- final intraSection =
-- a.intraSectionOrder.compareTo(b.intraSectionOrder);
++ final intraSection = a.intraSectionOrder.compareTo(
++ b.intraSectionOrder,
++ );
if (intraSection != 0) return intraSection;
return a.itemOrder.compareTo(b.itemOrder);
});
@@@ -325,7 -257,7 +259,8 @@@
final rows = <Widget>[];
String? currentSectionKey;
for (final entry in _filteredItems) {
-- final shouldShowHeader = sectionCounts[entry.sectionKey] != null &&
++ final shouldShowHeader =
++ sectionCounts[entry.sectionKey] != null &&
sectionCounts[entry.sectionKey]! >= 2;
if (shouldShowHeader && currentSectionKey != entry.sectionKey) {
currentSectionKey = entry.sectionKey;