π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] Adjust settings menu item pressed state
Neeraj Gupta5bde6e401cea
diff --git a/mobile/apps/photos/lib/theme/colors.dart b/mobile/apps/photos/lib/theme/colors.dartindex b36d86c243..33a9186be1 100644--- a/mobile/apps/photos/lib/theme/colors.dart+++ b/mobile/apps/photos/lib/theme/colors.dart@@ -58,6 +58,9 @@ class EnteColorScheme {final Color tabIcon;final List<Color> avatarColors;+ // Menu item icon stroke color+ final Color menuItemIconStroke;+const EnteColorScheme(this.backgroundBase,this.backgroundElevated,@@ -84,7 +87,8 @@ class EnteColorScheme {this.blurStrokeFaint,this.blurStrokePressed,this.tabIcon,- this.avatarColors, {+ this.avatarColors,+ this.menuItemIconStroke, {this.primary700 = _primary700,this.primary500 = _primary500,this.primary400 = _primary400,@@ -126,6 +130,7 @@ const EnteColorScheme lightScheme = EnteColorScheme(blurStrokePressedLight,tabIconLight,avatarLight,+ menuItemIconStrokeLight,);const EnteColorScheme darkScheme = EnteColorScheme(@@ -155,6 +160,7 @@ const EnteColorScheme darkScheme = EnteColorScheme(blurStrokePressedDark,tabIconDark,avatarDark,+ menuItemIconStrokeDark,);// Background Colors@@ -224,6 +230,10 @@ const Color blurStrokePressedDark = Color.fromRGBO(255, 255, 255, 0.50);const Color tabIconLight = Color.fromRGBO(0, 0, 0, 0.85);const Color tabIconDark = Color.fromRGBO(255, 255, 255, 0.80);+// Menu item icon stroke colors+const Color menuItemIconStrokeLight = Color(0xFF979797);+const Color menuItemIconStrokeDark = Color.fromRGBO(255, 255, 255, 1);+// Fixed Colorsconst Color fixedStrokeMutedWhite = Color.fromRGBO(255, 255, 255, 0.50);diff --git a/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_child_widgets.dart b/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_child_widgets.dartindex 85d24946af..fe55c8e546 100644--- a/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_child_widgets.dart+++ b/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_child_widgets.dart@@ -55,7 +55,8 @@ class _TrailingWidgetState extends State<TrailingWidget> {if (oldWidget.showExecutionStates && !widget.showExecutionStates) {// Was true, now false: remove listener and reset to iconif (_listenerAdded) {- oldWidget.executionStateNotifier.removeListener(_executionStateListener);+ oldWidget.executionStateNotifier+ .removeListener(_executionStateListener);_listenerAdded = false;}_setTrailingIcon();@@ -173,7 +174,7 @@ class LeadingWidget extends StatelessWidget {final Color? leadingIconColor;final Widget? leadingIconWidget;- // leadIconSize deafult value is 20.+ // leadIconSize default value is 20.final double leadingIconSize;const LeadingWidget({required this.leadingIconSize,diff --git a/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget_new.dart b/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget_new.dartindex b146c92e15..667efe9fab 100644--- a/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget_new.dart+++ b/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget_new.dart@@ -235,9 +235,15 @@ class _MenuItemWidgetNewState extends State<MenuItemWidgetNew> {}setState(() {if (widget.pressedColor == null) {- hasPassedGestureCallbacks()- ? menuItemColor = getEnteColorScheme(context).fillFaintPressed- : menuItemColor = widget.menuItemColor;+ if (hasPassedGestureCallbacks()) {+ final isDarkMode = Theme.of(context).brightness == Brightness.dark;+ // Pressed color: Light #F5F5F5, Dark #2C2C2C+ // These are the result of overlaying fillFaintPressed on the base color+ menuItemColor =+ isDarkMode ? const Color(0xFF2C2C2C) : const Color(0xFFF5F5F5);+ } else {+ menuItemColor = widget.menuItemColor;+ }} else {menuItemColor = widget.pressedColor;}@@ -272,8 +278,15 @@ class _MenuItemWidgetNewState extends State<MenuItemWidgetNew> {executionStateNotifier.value == ExecutionState.successful) {return;}- setState(() {- menuItemColor = widget.menuItemColor;- });+ Future.delayed(+ const Duration(milliseconds: 100),+ () {+ if (mounted) {+ setState(() {+ menuItemColor = widget.menuItemColor;+ });+ }+ },+ );}}diff --git a/mobile/apps/photos/lib/ui/components/settings/settings_grouped_card.dart b/mobile/apps/photos/lib/ui/components/settings/settings_grouped_card.dartindex 7f18c8aa19..f328fb9568 100644--- a/mobile/apps/photos/lib/ui/components/settings/settings_grouped_card.dart+++ b/mobile/apps/photos/lib/ui/components/settings/settings_grouped_card.dart@@ -32,8 +32,9 @@ class SettingsGroupedCard extends StatelessWidget {ClipRRect(borderRadius: BorderRadius.vertical(top: i == 0 ? const Radius.circular(20) : Radius.zero,- bottom:- i == childCount - 1 ? const Radius.circular(20) : Radius.zero,+ bottom: i == childCount - 1+ ? const Radius.circular(20)+ : Radius.zero,),child: children[i],),diff --git a/mobile/apps/photos/lib/ui/components/settings/settings_menu_item.dart b/mobile/apps/photos/lib/ui/components/settings/settings_menu_item.dartindex 2e36b763cc..d3f608b5c5 100644--- a/mobile/apps/photos/lib/ui/components/settings/settings_menu_item.dart+++ b/mobile/apps/photos/lib/ui/components/settings/settings_menu_item.dart@@ -47,7 +47,7 @@ class SettingsMenuItem extends StatelessWidget {child: Center(child: HugeIcon(icon: icon,- color: iconColor ?? colorScheme.strokeBase,+ color: iconColor ?? colorScheme.menuItemIconStroke,size: 20,),),diff --git a/mobile/apps/photos/lib/ui/components/settings/social_icons_row.dart b/mobile/apps/photos/lib/ui/components/settings/social_icons_row.dartindex 4ca4993ebc..d92a62a2c9 100644--- a/mobile/apps/photos/lib/ui/components/settings/social_icons_row.dart+++ b/mobile/apps/photos/lib/ui/components/settings/social_icons_row.dart@@ -4,6 +4,7 @@ import "package:photos/theme/ente_theme.dart";import "package:url_launcher/url_launcher_string.dart";/// A row of social media icons for the settings page.+/// Figma specs: 32x32 containers, 8px gap, icons 16-19px, strokeBase colorclass SocialIconsRow extends StatelessWidget {const SocialIconsRow({super.key});@@ -48,16 +49,22 @@ class SocialIconsRow extends StatelessWidget {mainAxisAlignment: MainAxisAlignment.center,children: socialLinks.map((link) {return Padding(- padding: const EdgeInsets.symmetric(horizontal: 12),+ padding: const EdgeInsets.symmetric(horizontal: 4),child: GestureDetector(onTap: () => _launchUrl(link.url),child: Semantics(label: link.label,button: true,- child: HugeIcon(- icon: link.icon,- color: colorScheme.strokeMuted,- size: 24,+ child: SizedBox(+ width: 32,+ height: 32,+ child: Center(+ child: HugeIcon(+ icon: link.icon,+ color: colorScheme.menuItemIconStroke,+ size: 18,+ ),+ ),),),),diff --git a/mobile/apps/photos/lib/ui/growth/change_referral_code_sheet.dart b/mobile/apps/photos/lib/ui/growth/change_referral_code_sheet.dartindex f04af954a6..f752c12dda 100644--- a/mobile/apps/photos/lib/ui/growth/change_referral_code_sheet.dart+++ b/mobile/apps/photos/lib/ui/growth/change_referral_code_sheet.dart@@ -89,7 +89,8 @@ class _ChangeReferralCodeContentStateif (e is DioException) {if (e.response?.statusCode == 400) {setState(() {- _errorMessage = AppLocalizations.of(context).unavailableReferralCode;+ _errorMessage =+ AppLocalizations.of(context).unavailableReferralCode;});} else if (e.response?.statusCode == 429) {setState(() {diff --git a/mobile/apps/photos/lib/ui/growth/referral_code_widget.dart b/mobile/apps/photos/lib/ui/growth/referral_code_widget.dartindex 510558de07..ed899759e8 100644--- a/mobile/apps/photos/lib/ui/growth/referral_code_widget.dart+++ b/mobile/apps/photos/lib/ui/growth/referral_code_widget.dart@@ -80,8 +80,8 @@ class ReferralCodeWidget extends StatelessWidget {showInfoDialog(context,title: AppLocalizations.of(context).error,- body:- AppLocalizations.of(context).onlyFamilyAdminCanChangeCode(+ body: AppLocalizations.of(context)+ .onlyFamilyAdminCanChangeCode(familyAdminEmail: familyAdmin,),icon: Icons.error,diff --git a/mobile/apps/photos/lib/ui/growth/storage_details_screen.dart b/mobile/apps/photos/lib/ui/growth/storage_details_screen.dartindex 0dd9fd30d1..11b2b1b984 100644--- a/mobile/apps/photos/lib/ui/growth/storage_details_screen.dart+++ b/mobile/apps/photos/lib/ui/growth/storage_details_screen.dart@@ -121,8 +121,8 @@ class _StorageDetailsScreenState extends State<StorageDetailsScreen> {Expanded(child: _StatCard(value: data.refCount.toString(),- label: AppLocalizations.of(context)- .usedYourCode,+ label:+ AppLocalizations.of(context).usedYourCode,cardColor: cardColor,),),@@ -130,8 +130,7 @@ class _StorageDetailsScreenState extends State<StorageDetailsScreen> {Expanded(child: _StatCard(value: data.refUpgradeCount.toString(),- label:- AppLocalizations.of(context).eligible,+ label: AppLocalizations.of(context).eligible,cardColor: cardColor,),),@@ -145,8 +144,8 @@ class _StorageDetailsScreenState extends State<StorageDetailsScreen> {Expanded(child: _StatCard(value: "1",- label: AppLocalizations.of(context)- .claimedByYou,+ label:+ AppLocalizations.of(context).claimedByYou,cardColor: cardColor,),),diff --git a/mobile/apps/photos/lib/ui/settings/about/about_us_page.dart b/mobile/apps/photos/lib/ui/settings/about/about_us_page.dartindex 300bf7fa8a..869cec7e9f 100644--- a/mobile/apps/photos/lib/ui/settings/about/about_us_page.dart+++ b/mobile/apps/photos/lib/ui/settings/about/about_us_page.dart@@ -160,7 +160,7 @@ class AboutUsPage extends StatelessWidget {final colorScheme = getEnteColorScheme(context);return HugeIcon(icon: icon,- color: colorScheme.strokeBase,+ color: colorScheme.menuItemIconStroke,size: 20,);}diff --git a/mobile/apps/photos/lib/ui/settings/account/account_settings_page.dart b/mobile/apps/photos/lib/ui/settings/account/account_settings_page.dartindex b6be294e34..40438dc76f 100644--- a/mobile/apps/photos/lib/ui/settings/account/account_settings_page.dart+++ b/mobile/apps/photos/lib/ui/settings/account/account_settings_page.dart@@ -147,7 +147,9 @@ class AccountSettingsPage extends StatelessWidget {final colorScheme = getEnteColorScheme(context);return HugeIcon(icon: icon,- color: isDestructive ? colorScheme.warning700 : colorScheme.strokeBase,+ color: isDestructive+ ? colorScheme.warning700+ : colorScheme.menuItemIconStroke,size: 20,);}diff --git a/mobile/apps/photos/lib/ui/settings/app_version_widget.dart b/mobile/apps/photos/lib/ui/settings/app_version_widget.dartindex d341906b71..4a02b85360 100644--- a/mobile/apps/photos/lib/ui/settings/app_version_widget.dart+++ b/mobile/apps/photos/lib/ui/settings/app_version_widget.dart@@ -1,6 +1,7 @@import 'package:flutter/material.dart';import 'package:package_info_plus/package_info_plus.dart';import "package:photos/generated/l10n.dart";+import "package:photos/theme/ente_theme.dart";class AppVersionWidget extends StatefulWidget {const AppVersionWidget({@@ -45,13 +46,14 @@ class _AppVersionWidgetState extends State<AppVersionWidget> {future: _versionFuture,builder: (context, snapshot) {if (snapshot.hasData) {+ final textTheme = getEnteTextTheme(context);return Padding(- padding: const EdgeInsets.all(20),+ padding: const EdgeInsets.symmetric(vertical: 20),child: Center(child: Text(AppLocalizations.of(context).appVersion(versionValue: snapshot.data!),- style: Theme.of(context).textTheme.bodySmall,+ style: textTheme.smallMuted,),),);diff --git a/mobile/apps/photos/lib/ui/settings/appearance/appearance_settings_page.dart b/mobile/apps/photos/lib/ui/settings/appearance/appearance_settings_page.dartindex 0f4791d761..2bb42e40c6 100644--- a/mobile/apps/photos/lib/ui/settings/appearance/appearance_settings_page.dart+++ b/mobile/apps/photos/lib/ui/settings/appearance/appearance_settings_page.dart@@ -145,7 +145,7 @@ class _AppearanceSettingsPageState extends State<AppearanceSettingsPage> {final colorScheme = getEnteColorScheme(context);return HugeIcon(icon: icon,- color: colorScheme.strokeBase,+ color: colorScheme.menuItemIconStroke,size: 20,);}diff --git a/mobile/apps/photos/lib/ui/settings/backup/backup_settings_page.dart b/mobile/apps/photos/lib/ui/settings/backup/backup_settings_page.dartindex 9554009bfb..0c26068e26 100644--- a/mobile/apps/photos/lib/ui/settings/backup/backup_settings_page.dart+++ b/mobile/apps/photos/lib/ui/settings/backup/backup_settings_page.dart@@ -106,7 +106,7 @@ class BackupSettingsPage extends StatelessWidget {final colorScheme = getEnteColorScheme(context);return HugeIcon(icon: icon,- color: colorScheme.strokeBase,+ color: colorScheme.menuItemIconStroke,size: 20,);}diff --git a/mobile/apps/photos/lib/ui/settings/debug/debug_settings_page.dart b/mobile/apps/photos/lib/ui/settings/debug/debug_settings_page.dartindex be7ca3e9e9..0f3713fb81 100644--- a/mobile/apps/photos/lib/ui/settings/debug/debug_settings_page.dart+++ b/mobile/apps/photos/lib/ui/settings/debug/debug_settings_page.dart@@ -143,8 +143,7 @@ class _DebugSettingsPageState extends State<DebugSettingsPage> {value: () =>localSettings.isChristmasBannerEnabled,onChanged: () async {- await localSettings- .setChristmasBannerEnabled(+ await localSettings.setChristmasBannerEnabled(!localSettings.isChristmasBannerEnabled,);Bus.instance.fire(ChristmasBannerEvent());@@ -231,7 +230,7 @@ class _DebugSettingsPageState extends State<DebugSettingsPage> {final colorScheme = getEnteColorScheme(context);return HugeIcon(icon: icon,- color: colorScheme.strokeBase,+ color: colorScheme.menuItemIconStroke,size: 20,);}diff --git a/mobile/apps/photos/lib/ui/settings/debug/ml_debug_settings_page.dart b/mobile/apps/photos/lib/ui/settings/debug/ml_debug_settings_page.dartindex 0b08ef5974..3c8022cae9 100644--- a/mobile/apps/photos/lib/ui/settings/debug/ml_debug_settings_page.dart+++ b/mobile/apps/photos/lib/ui/settings/debug/ml_debug_settings_page.dart@@ -492,7 +492,7 @@ class _MLDebugSettingsPageState extends State<MLDebugSettingsPage> {final colorScheme = getEnteColorScheme(context);return HugeIcon(icon: icon,- color: colorScheme.strokeBase,+ color: colorScheme.menuItemIconStroke,size: 20,);}diff --git a/mobile/apps/photos/lib/ui/settings/security/security_settings_page.dart b/mobile/apps/photos/lib/ui/settings/security/security_settings_page.dartindex 032561ef96..a4d329a9fb 100644--- a/mobile/apps/photos/lib/ui/settings/security/security_settings_page.dart+++ b/mobile/apps/photos/lib/ui/settings/security/security_settings_page.dart@@ -169,7 +169,7 @@ class _SecuritySettingsPageState extends State<SecuritySettingsPage> {final colorScheme = getEnteColorScheme(context);return HugeIcon(icon: icon,- color: colorScheme.strokeBase,+ color: colorScheme.menuItemIconStroke,size: 20,);}diff --git a/mobile/apps/photos/lib/ui/settings/support/help_support_page.dart b/mobile/apps/photos/lib/ui/settings/support/help_support_page.dartindex 0e5e243edb..6d559a6ab9 100644--- a/mobile/apps/photos/lib/ui/settings/support/help_support_page.dart+++ b/mobile/apps/photos/lib/ui/settings/support/help_support_page.dart@@ -152,7 +152,7 @@ class HelpSupportPage extends StatelessWidget {final colorScheme = getEnteColorScheme(context);return HugeIcon(icon: icon,- color: colorScheme.strokeBase,+ color: colorScheme.menuItemIconStroke,size: 20,);}diff --git a/mobile/apps/photos/lib/ui/settings_page.dart b/mobile/apps/photos/lib/ui/settings_page.dartindex c5fdf4279c..4167ecbae6 100644--- a/mobile/apps/photos/lib/ui/settings_page.dart+++ b/mobile/apps/photos/lib/ui/settings_page.dart@@ -114,9 +114,11 @@ class _SettingsBody extends StatelessWidget {const SizedBox(height: 8),if (hasLoggedIn) ...[_buildLogoutCard(context, colorScheme),- const SizedBox(height: 16),],- const SocialIconsRow(),+ const Padding(+ padding: EdgeInsets.symmetric(vertical: 28),+ child: SocialIconsRow(),+ ),const AppVersionWidget(),if (hasLoggedIn &&(flagService.flags.internalUser || kDebugMode)) ...[@@ -204,7 +206,9 @@ class _SettingsBody extends StatelessWidget {}) {return HugeIcon(icon: icon,- color: isDestructive ? colorScheme.warning700 : colorScheme.strokeBase,+ color: isDestructive+ ? colorScheme.warning700+ : colorScheme.menuItemIconStroke,size: 20,);}