Skip to content

armgit / ente

Public Imported from GitHub
0

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

Open album only from shared grid +N badge

ashilkn4ff1bdca2da6
diff --git a/mobile/apps/photos/lib/ui/social/feed_screen.dart b/mobile/apps/photos/lib/ui/social/feed_screen.dart
index 46678deb8c..584d169c7b 100644
--- a/mobile/apps/photos/lib/ui/social/feed_screen.dart
+++ b/mobile/apps/photos/lib/ui/social/feed_screen.dart
@@ -582,6 +582,13 @@ class _FeedScreenState extends State<FeedScreen> {
item,
initialFileID: fileID,
),
+ onSharedExtraCountTap: () => _openSharedCollection(
+ item,
+ jumpToFileID: _jumpFileIDForSharedCollection(
+ type: item.type,
+ sharedFileIDs: item.sharedFileIDs,
+ ),
+ ),
);
},
),
diff --git a/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart
index cfa00f5217..c1b41ad911 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart
@@ -28,6 +28,9 @@ class FeedItemWidget extends StatelessWidget {
/// Called when the user taps shared-feed header text/avatar area.
final VoidCallback? onSharedHeaderTap;
+ /// Called when the user taps the +N extra-count badge in the shared grid.
+ final VoidCallback? onSharedExtraCountTap;
+
/// Map of anonUserID -> decrypted display name for the collection.
final Map<String, String> anonDisplayNames;
@@ -40,6 +43,7 @@ class FeedItemWidget extends StatelessWidget {
this.onTap,
this.onSharedPhotoTap,
this.onSharedHeaderTap,
+ this.onSharedExtraCountTap,
this.anonDisplayNames = const {},
this.isLastItem = false,
super.key,
@@ -191,6 +195,7 @@ class FeedItemWidget extends StatelessWidget {
collectionID: feedItem.collectionID,
onTap: onTap,
onPhotoTap: onSharedPhotoTap,
+ onExtraCountTap: onSharedExtraCountTap,
),
),
],
diff --git a/mobile/apps/photos/lib/ui/social/widgets/shared_photos_grid.dart b/mobile/apps/photos/lib/ui/social/widgets/shared_photos_grid.dart
index 1af05c915d..96c6731ebd 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/shared_photos_grid.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/shared_photos_grid.dart
@@ -26,6 +26,9 @@ class SharedPhotosGrid extends StatefulWidget {
/// Called when user taps an individual photo thumbnail.
final ValueChanged<int>? onPhotoTap;
+ /// Called when user taps the +N extra-count badge.
+ final VoidCallback? onExtraCountTap;
+
/// Size of the grid (width). Height is calculated based on layout.
final double gridSize;
@@ -34,6 +37,7 @@ class SharedPhotosGrid extends StatefulWidget {
required this.collectionID,
this.onTap,
this.onPhotoTap,
+ this.onExtraCountTap,
this.gridSize = 300,
super.key,
});
@@ -280,25 +284,35 @@ class _SharedPhotosGridState extends State<SharedPhotosGrid> {
}
Widget _buildExtraCountOverlay(int extraCount) {
+ final badge = Container(
+ padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
+ decoration: BoxDecoration(
+ color: const Color(0x99000000),
+ borderRadius: BorderRadius.circular(100),
+ ),
+ child: Text(
+ '+$extraCount',
+ style: const TextStyle(
+ color: Colors.white,
+ fontSize: 13,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ );
+
+ final tappableBadge = widget.onExtraCountTap == null
+ ? badge
+ : GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: widget.onExtraCountTap,
+ child: badge,
+ );
+
return Align(
alignment: Alignment.bottomRight,
child: Padding(
padding: const EdgeInsets.all(6),
- child: Container(
- padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
- decoration: BoxDecoration(
- color: const Color(0x99000000),
- borderRadius: BorderRadius.circular(100),
- ),
- child: Text(
- '+$extraCount',
- style: const TextStyle(
- color: Colors.white,
- fontSize: 13,
- fontWeight: FontWeight.w600,
- ),
- ),
- ),
+ child: tappableBadge,
),
);
}