feat(mobile): Change the UI of asset activity list to bottom sheet (#23075)

* init of activities bottom sheet

* reverse list order, padding bottom...

* chore: remove scrolling

* chore: clean up

* chore

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
idubnori 2025-10-21 03:35:52 +09:00 committed by GitHub
parent 05f174a180
commit becb56e1b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 243 additions and 27 deletions

View file

@ -9,8 +9,9 @@ import 'package:immich_mobile/widgets/common/user_circle_avatar.dart';
class ActivityTile extends HookConsumerWidget {
final Activity activity;
final bool isBottomSheet;
const ActivityTile(this.activity, {super.key});
const ActivityTile(this.activity, {super.key, this.isBottomSheet = false});
@override
Widget build(BuildContext context, WidgetRef ref) {
@ -18,21 +19,23 @@ class ActivityTile extends HookConsumerWidget {
final isLike = activity.type == ActivityType.like;
// Asset thumbnail is displayed when we are accessing activities from the album page
// currentAssetProvider will not be set until we open the gallery viewer
final showAssetThumbnail = asset == null && activity.assetId != null;
final showAssetThumbnail = asset == null && activity.assetId != null && !isBottomSheet;
return ListTile(
minVerticalPadding: 15,
leading: isLike
? Container(
width: 44,
width: isBottomSheet ? 30 : 44,
alignment: Alignment.center,
child: Icon(Icons.favorite_rounded, color: Colors.red[700]),
)
: isBottomSheet
? UserCircleAvatar(user: activity.user, size: 30, radius: 15)
: UserCircleAvatar(user: activity.user),
title: _ActivityTitle(
userName: activity.user.name,
createdAt: activity.createdAt.timeAgo(),
leftAlign: isLike || showAssetThumbnail,
leftAlign: isBottomSheet ? false : (isLike || showAssetThumbnail),
),
// No subtitle for like, so center title
titleAlignment: !isLike ? ListTileTitleAlignment.top : ListTileTitleAlignment.center,