From e850dae7beea78d1b4b89f25412c4f9edf84afea Mon Sep 17 00:00:00 2001 From: ashilkn Date: Thu, 23 Jan 2025 12:15:51 +0530 Subject: [PATCH] [mob][photos] Show 'Reassign Me' option on PeopleAppBar if 'Me' is assigned and the person 'Me' is opened --- .../lib/ui/viewer/people/people_app_bar.dart | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/mobile/lib/ui/viewer/people/people_app_bar.dart b/mobile/lib/ui/viewer/people/people_app_bar.dart index bbf74ec18c..4de6f6da7d 100644 --- a/mobile/lib/ui/viewer/people/people_app_bar.dart +++ b/mobile/lib/ui/viewer/people/people_app_bar.dart @@ -1,6 +1,5 @@ import 'dart:async'; -import "package:flutter/cupertino.dart"; import 'package:flutter/material.dart'; import 'package:logging/logging.dart'; import 'package:photos/core/configuration.dart'; @@ -15,6 +14,7 @@ import "package:photos/models/ml/face/person.dart"; import 'package:photos/models/selected_files.dart'; import 'package:photos/services/collections_service.dart'; import "package:photos/services/machine_learning/face_ml/person/person_service.dart"; +import "package:photos/theme/ente_theme.dart"; import 'package:photos/ui/actions/collection/collection_sharing_actions.dart'; import "package:photos/ui/viewer/gallery/state/inherited_search_filter_data.dart"; import "package:photos/ui/viewer/hierarchicial_search/applied_filters_for_appbar.dart"; @@ -52,6 +52,7 @@ enum PeoplePopupAction { removeLabel, reviewSuggestions, unignore, + reassignMe, } class _AppBarWidgetState extends State { @@ -176,6 +177,7 @@ class _AppBarWidgetState extends State { } List _getDefaultActions(BuildContext context) { + final textTheme = getEnteTextTheme(context); final List actions = []; // If the user has selected files, don't show any actions if (widget.selectedFiles.files.isNotEmpty || @@ -196,7 +198,10 @@ class _AppBarWidgetState extends State { const Padding( padding: EdgeInsets.all(8), ), - Text(S.of(context).edit), + Text( + S.of(context).edit, + style: textTheme.bodyBold, + ), ], ), ), @@ -208,7 +213,10 @@ class _AppBarWidgetState extends State { const Padding( padding: EdgeInsets.all(8), ), - Text(S.of(context).review), + Text( + S.of(context).review, + style: textTheme.bodyBold, + ), ], ), ), @@ -220,10 +228,30 @@ class _AppBarWidgetState extends State { const Padding( padding: EdgeInsets.all(8), ), - Text(S.of(context).remove), + Text( + S.of(context).remove, + style: textTheme.bodyBold, + ), ], ), ), + if (widget.person.data.email != null && + (widget.person.data.email == Configuration.instance.getEmail())) + PopupMenuItem( + value: PeoplePopupAction.reassignMe, + child: Row( + children: [ + const Icon(Icons.delete_outline), + const Padding( + padding: EdgeInsets.all(8), + ), + Text( + "Reassign \"Me\"", + style: textTheme.bodyBold, + ), + ], + ), + ), ], ); } else {