mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
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:
parent
05f174a180
commit
becb56e1b1
8 changed files with 243 additions and 27 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue