mirror of
https://github.com/immich-app/immich.git
synced 2025-12-19 09:13:14 +03:00
feat(mobile): move activity button to action button menu
This commit is contained in:
@@ -51,13 +51,6 @@ class ViewerTopAppBar extends ConsumerWidget implements PreferredSizeWidget {
|
|||||||
|
|
||||||
final actions = <Widget>[
|
final actions = <Widget>[
|
||||||
if (asset.isMotionPhoto) const MotionPhotoActionButton(iconOnly: true),
|
if (asset.isMotionPhoto) const MotionPhotoActionButton(iconOnly: true),
|
||||||
if (album != null && album.isActivityEnabled && album.isShared)
|
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Icons.chat_outlined),
|
|
||||||
onPressed: () {
|
|
||||||
EventStream.shared.emit(const ViewerOpenBottomSheetEvent(activitiesMode: true));
|
|
||||||
},
|
|
||||||
),
|
|
||||||
|
|
||||||
if (asset.hasRemote && isOwner && !asset.isFavorite)
|
if (asset.hasRemote && isOwner && !asset.isFavorite)
|
||||||
const FavoriteActionButton(source: ActionSource.viewer, iconOnly: true),
|
const FavoriteActionButton(source: ActionSource.viewer, iconOnly: true),
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class ActionButtonContext {
|
|||||||
|
|
||||||
enum ActionButtonType {
|
enum ActionButtonType {
|
||||||
openInfo,
|
openInfo,
|
||||||
|
openActivity,
|
||||||
likeActivity,
|
likeActivity,
|
||||||
share,
|
share,
|
||||||
shareLink,
|
shareLink,
|
||||||
@@ -138,6 +139,11 @@ enum ActionButtonType {
|
|||||||
context.isOwner && //
|
context.isOwner && //
|
||||||
!context.isInLockedView && //
|
!context.isInLockedView && //
|
||||||
context.isStacked,
|
context.isStacked,
|
||||||
|
ActionButtonType.openActivity =>
|
||||||
|
!context.isInLockedView &&
|
||||||
|
context.currentAlbum != null &&
|
||||||
|
context.currentAlbum!.isActivityEnabled &&
|
||||||
|
context.currentAlbum!.isShared,
|
||||||
ActionButtonType.likeActivity =>
|
ActionButtonType.likeActivity =>
|
||||||
!context.isInLockedView &&
|
!context.isInLockedView &&
|
||||||
context.currentAlbum != null &&
|
context.currentAlbum != null &&
|
||||||
@@ -227,6 +233,13 @@ enum ActionButtonType {
|
|||||||
menuItem: true,
|
menuItem: true,
|
||||||
onPressed: () => EventStream.shared.emit(const ViewerOpenBottomSheetEvent()),
|
onPressed: () => EventStream.shared.emit(const ViewerOpenBottomSheetEvent()),
|
||||||
),
|
),
|
||||||
|
ActionButtonType.openActivity => BaseActionButton(
|
||||||
|
label: 'activity'.tr(),
|
||||||
|
iconData: Icons.chat_outlined,
|
||||||
|
iconColor: context.originalTheme?.iconTheme.color,
|
||||||
|
menuItem: true,
|
||||||
|
onPressed: () => EventStream.shared.emit(const ViewerOpenBottomSheetEvent(activitiesMode: true)),
|
||||||
|
),
|
||||||
ActionButtonType.viewInTimeline => BaseActionButton(
|
ActionButtonType.viewInTimeline => BaseActionButton(
|
||||||
label: 'view_in_timeline'.tr(),
|
label: 'view_in_timeline'.tr(),
|
||||||
iconData: Icons.image_search,
|
iconData: Icons.image_search,
|
||||||
@@ -249,7 +262,7 @@ enum ActionButtonType {
|
|||||||
/// Buttons in the same group will be displayed together,
|
/// Buttons in the same group will be displayed together,
|
||||||
/// with dividers separating different groups.
|
/// with dividers separating different groups.
|
||||||
int get kebabMenuGroup => switch (this) {
|
int get kebabMenuGroup => switch (this) {
|
||||||
// 0: info
|
// 0: info and activity
|
||||||
ActionButtonType.openInfo => 0,
|
ActionButtonType.openInfo => 0,
|
||||||
// 10: move,remove, and delete
|
// 10: move,remove, and delete
|
||||||
ActionButtonType.trash => 10,
|
ActionButtonType.trash => 10,
|
||||||
|
|||||||
Reference in New Issue
Block a user