mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(mobile): Library page rework (album sorting, favorites) (#1501)
* Add album sorting * Change AppBar to match photos page behaviour * Add buttons * First crude implementation of the favorites page * Clean up * Add favorite button * i18n * Add star indicator to thumbnail * Add favorite logic to separate provider and fix favorite behavior in album * Review feedback (Add isFavorite variable) * dev: style buttons * dev: styled drop down button --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@@ -14,6 +14,8 @@ class TopControlAppBar extends HookConsumerWidget {
|
||||
required this.onAddToAlbumPressed,
|
||||
required this.onToggleMotionVideo,
|
||||
required this.isPlayingMotionVideo,
|
||||
required this.onFavorite,
|
||||
required this.isFavorite,
|
||||
}) : super(key: key);
|
||||
|
||||
final Asset asset;
|
||||
@@ -22,13 +24,29 @@ class TopControlAppBar extends HookConsumerWidget {
|
||||
final VoidCallback onToggleMotionVideo;
|
||||
final VoidCallback onDeletePressed;
|
||||
final VoidCallback onAddToAlbumPressed;
|
||||
final VoidCallback onFavorite;
|
||||
final Function onSharePressed;
|
||||
final bool isPlayingMotionVideo;
|
||||
final bool isFavorite;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
double iconSize = 18.0;
|
||||
|
||||
Widget buildFavoriteButton() {
|
||||
return IconButton(
|
||||
iconSize: iconSize,
|
||||
splashRadius: iconSize,
|
||||
onPressed: () {
|
||||
onFavorite();
|
||||
},
|
||||
icon: Icon(
|
||||
isFavorite ? Icons.star : Icons.star_border,
|
||||
color: Colors.grey[200],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return AppBar(
|
||||
foregroundColor: Colors.grey[100],
|
||||
backgroundColor: Colors.transparent,
|
||||
@@ -43,6 +61,7 @@ class TopControlAppBar extends HookConsumerWidget {
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
if (asset.isRemote) buildFavoriteButton(),
|
||||
if (asset.livePhotoVideoId != null)
|
||||
IconButton(
|
||||
iconSize: iconSize,
|
||||
|
||||
Reference in New Issue
Block a user