commit 4647a493653b457e1e838d10fbf436695be29ec7 parent d52424327320366a9c0812939285d07bbb96d77a Author: Gabriel Luong <gabriel.luong@gmail.com> Date: Sat, 6 Dec 2025 00:29:34 +0000 Bug 2004428 - Part 3: Align the History app bar edit mode colors with the Bookmarks and Downloads screen r=android-reviewers,007 - This aligns the edit mode colors for the app bar between the History, Bookmarks and Downloads screen. - Fixes the usage of `inverseOnSurface` to `onPrimary`. These are the same colors, but semantically using `onPrimary` on `Primary` has a better flow. - Follow up bug to be filed is to remove all of these edit mode colors because that will be going away with the M3 specs update. For now, we are just aligning the colors so the screens will look unified. Differential Revision: https://phabricator.services.mozilla.com/D275300 Diffstat:
5 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/bookmarks/BookmarksScreen.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/bookmarks/BookmarksScreen.kt @@ -608,13 +608,13 @@ private fun BookmarksListTopBar( val textColor = if (selectedItems.isEmpty()) { MaterialTheme.colorScheme.onSurface } else { - MaterialTheme.colorScheme.inverseOnSurface + MaterialTheme.colorScheme.onPrimary } val iconColor = if (selectedItems.isEmpty()) { MaterialTheme.colorScheme.onSurface } else { - MaterialTheme.colorScheme.inverseOnSurface + MaterialTheme.colorScheme.onPrimary } Box { diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/downloads/listscreen/DownloadsScreen.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/downloads/listscreen/DownloadsScreen.kt @@ -561,8 +561,8 @@ private fun getToolbarConfig(mode: Mode): ToolbarConfig { mode.selectedItems.size, ), backgroundColor = MaterialTheme.colorScheme.primary, - textColor = MaterialTheme.colorScheme.inverseOnSurface, - iconColor = MaterialTheme.colorScheme.inverseOnSurface, + textColor = MaterialTheme.colorScheme.onPrimary, + iconColor = MaterialTheme.colorScheme.onPrimary, ) is Mode.Normal -> ToolbarConfig( diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/library/LibraryPageView.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/library/LibraryPageView.kt @@ -7,7 +7,6 @@ package org.mozilla.fenix.library import android.content.Context import android.view.ViewGroup import androidx.appcompat.widget.Toolbar -import androidx.core.content.ContextCompat import mozilla.components.support.ktx.android.content.getColorFromAttr import org.mozilla.fenix.R import org.mozilla.fenix.ext.asActivity @@ -36,11 +35,8 @@ open class LibraryPageView( ) { updateToolbar( title = title, - foregroundColor = ContextCompat.getColor( - context, - R.color.fx_mobile_text_color_oncolor_primary, - ), - backgroundColor = context.getColorFromAttr(R.attr.accent), + foregroundColor = context.getColorFromAttr(materialR.attr.colorOnPrimary), + backgroundColor = context.getColorFromAttr(materialR.attr.colorPrimarySurface), ) } diff --git a/mobile/android/fenix/app/src/main/res/menu/history_select_multi.xml b/mobile/android/fenix/app/src/main/res/menu/history_select_multi.xml @@ -6,8 +6,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/share_history_multi_select" - android:icon="@drawable/ic_share" - app:iconTint="@color/fx_mobile_icon_color_oncolor" + android:icon="@drawable/mozac_ic_share_android_24" + app:iconTint="?attr/colorOnPrimary" android:title="@string/browser_menu_share" app:showAsAction="ifRoom" /> <item diff --git a/mobile/android/fenix/app/src/main/res/values/styles.xml b/mobile/android/fenix/app/src/main/res/values/styles.xml @@ -47,7 +47,7 @@ <item name="mozacSelectAddressHeaderTextStyle" tools:ignore="UnusedResources">@style/SelectPromptHeaderTextStyle</item> <!-- Material3 --> - <item name="colorPrimary">@color/fx_mobile_primary</item> + <item name="colorPrimarySurface">@color/fx_mobile_primary</item> <item name="colorOnPrimary">@color/fx_mobile_on_primary</item> <item name="colorPrimaryContainer">@color/fx_mobile_primary_container</item> <item name="colorOnPrimaryContainer">@color/fx_mobile_on_primary_container</item> @@ -344,7 +344,7 @@ <item name="mozacSelectAddressHeaderTextStyle" tools:ignore="UnusedResources">@style/SelectPromptHeaderTextStyle</item> <!-- Material3 --> - <item name="colorPrimary">@color/fx_mobile_private_primary</item> + <item name="colorPrimarySurface">@color/fx_mobile_private_primary</item> <item name="colorOnPrimary">@color/fx_mobile_private_on_primary</item> <item name="colorPrimaryContainer">@color/fx_mobile_private_primary_container</item> <item name="colorOnPrimaryContainer">@color/fx_mobile_private_on_primary_container</item>