feat(mobile): move activity button to action button menu

This commit is contained in:
idubnori
2025-12-16 16:58:06 +09:00
parent 8416397589
commit 7d4de5f2e2
2 changed files with 14 additions and 8 deletions

View File

@@ -51,13 +51,6 @@ class ViewerTopAppBar extends ConsumerWidget implements PreferredSizeWidget {
final actions = <Widget>[
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)
const FavoriteActionButton(source: ActionSource.viewer, iconOnly: true),

View File

@@ -61,6 +61,7 @@ class ActionButtonContext {
enum ActionButtonType {
openInfo,
openActivity,
likeActivity,
share,
shareLink,
@@ -138,6 +139,11 @@ enum ActionButtonType {
context.isOwner && //
!context.isInLockedView && //
context.isStacked,
ActionButtonType.openActivity =>
!context.isInLockedView &&
context.currentAlbum != null &&
context.currentAlbum!.isActivityEnabled &&
context.currentAlbum!.isShared,
ActionButtonType.likeActivity =>
!context.isInLockedView &&
context.currentAlbum != null &&
@@ -227,6 +233,13 @@ enum ActionButtonType {
menuItem: true,
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(
label: 'view_in_timeline'.tr(),
iconData: Icons.image_search,
@@ -249,7 +262,7 @@ enum ActionButtonType {
/// Buttons in the same group will be displayed together,
/// with dividers separating different groups.
int get kebabMenuGroup => switch (this) {
// 0: info
// 0: info and activity
ActionButtonType.openInfo => 0,
// 10: move,remove, and delete
ActionButtonType.trash => 10,