commit d52424327320366a9c0812939285d07bbb96d77a parent 82f18622d603accd6910563ee92ad28f6e85d8b5 Author: Gabriel Luong <gabriel.luong@gmail.com> Date: Sat, 6 Dec 2025 00:29:33 +0000 Bug 2004428 - Part 2: Replace ic_back_button drawable with mozac_ic_back_24 r=android-reviewers,007 Differential Revision: https://phabricator.services.mozilla.com/D275299 Diffstat:
6 files changed, 9 insertions(+), 23 deletions(-)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt @@ -169,6 +169,7 @@ import org.mozilla.fenix.utils.AccessibilityUtils.announcePrivateModeForAccessib import org.mozilla.fenix.utils.Settings import org.mozilla.fenix.utils.changeAppLauncherIcon import java.util.Locale +import mozilla.components.ui.icons.R as iconsR /** * The main activity of the application. The application is primarily a single Activity (this one) @@ -1193,7 +1194,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { setSupportActionBar(navigationToolbar) // Add ids to this that we don't want to have a toolbar back button setupNavigationToolbar() - setNavigationIcon(R.drawable.ic_back_button) + setNavigationIcon(iconsR.drawable.mozac_ic_back_24) isToolbarInflated = true } diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/ext/Fragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/ext/Fragment.kt @@ -37,6 +37,7 @@ import org.mozilla.fenix.components.toolbar.ToolbarPosition import org.mozilla.fenix.navigation.DefaultNavControllerProvider import org.mozilla.fenix.navigation.NavControllerProvider import org.mozilla.fenix.utils.isLargeScreenSize +import mozilla.components.ui.icons.R as iconsR /** * Get the requireComponents of this application. @@ -73,7 +74,7 @@ fun Fragment.getPreferenceKey(@StringRes resourceId: Int): String = getString(re */ fun Fragment.showToolbar(title: String) { (requireActivity() as AppCompatActivity).title = title - activity?.setNavigationIcon(R.drawable.ic_back_button) + activity?.setNavigationIcon(iconsR.drawable.mozac_ic_back_24) (activity as? NavHostActivity)?.getSupportActionBarAndInflateIfNecessary()?.show() } @@ -93,7 +94,7 @@ fun Fragment.showToolbarWithIconButton( ) { val activity = requireActivity() as AppCompatActivity activity.title = title - activity.setNavigationIcon(R.drawable.ic_back_button) + activity.setNavigationIcon(iconsR.drawable.mozac_ic_back_24) (activity as? NavHostActivity)?.getSupportActionBarAndInflateIfNecessary()?.show() val menuHost = activity as MenuHost 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 @@ -13,6 +13,7 @@ import org.mozilla.fenix.R import org.mozilla.fenix.ext.asActivity import org.mozilla.fenix.ext.setToolbarColors import com.google.android.material.R as materialR +import mozilla.components.ui.icons.R as iconsR open class LibraryPageView( val containerView: ViewGroup, @@ -47,7 +48,7 @@ open class LibraryPageView( activity?.title = title val toolbar = activity?.findViewById<Toolbar>(R.id.navigationToolbar) toolbar?.setToolbarColors(foregroundColor, backgroundColor) - toolbar?.setNavigationIcon(R.drawable.ic_back_button) + toolbar?.setNavigationIcon(iconsR.drawable.mozac_ic_back_24) toolbar?.navigationIcon?.setTint(foregroundColor) } } diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/settingssearch/SettingsSearchBar.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/settingssearch/SettingsSearchBar.kt @@ -32,7 +32,6 @@ import mozilla.components.compose.base.button.IconButton import mozilla.components.compose.base.theme.AcornTheme import mozilla.components.lib.state.ext.observeAsComposableState import org.mozilla.fenix.R -import org.mozilla.fenix.theme.FirefoxTheme import mozilla.components.ui.icons.R as iconsR /** @@ -140,10 +139,9 @@ private fun BackButton( ) { Icon( painter = painterResource( - R.drawable.ic_back_button, + iconsR.drawable.mozac_ic_back_24, ), contentDescription = null, - tint = FirefoxTheme.colors.textPrimary, ) } } @@ -161,7 +159,6 @@ private fun ClearTextButton( Icon( painter = painterResource(iconsR.drawable.mozac_ic_cross_circle_fill_24), contentDescription = null, - tint = FirefoxTheme.colors.textPrimary, ) } } diff --git a/mobile/android/fenix/app/src/main/res/drawable/ic_back_button.xml b/mobile/android/fenix/app/src/main/res/drawable/ic_back_button.xml @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- This Source Code Form is subject to the terms of the Mozilla Public - - License, v. 2.0. If a copy of the MPL was not distributed with this - - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="24dp" - android:height="24dp" - android:autoMirrored="true" - android:viewportWidth="24" - android:viewportHeight="24"> - <path - android:fillColor="?attr/textPrimary" - android:pathData="M20.25,11.5H5.461L11.431,5.53C11.724,5.237 11.724,4.762 11.431,4.469C11.138,4.176 10.663,4.176 10.37,4.469L3,11.839V12.66L10.37,20.03C10.516,20.176 10.708,20.25 10.9,20.25C11.092,20.25 11.284,20.177 11.43,20.03C11.723,19.737 11.723,19.262 11.43,18.969L5.461,13H20.25C20.664,13 21,12.664 21,12.25C21,11.836 20.664,11.5 20.25,11.5Z" /> -</vector> diff --git a/mobile/android/fenix/app/src/test/java/org/mozilla/fenix/components/toolbar/CustomTabBrowserToolbarMiddlewareTest.kt b/mobile/android/fenix/app/src/test/java/org/mozilla/fenix/components/toolbar/CustomTabBrowserToolbarMiddlewareTest.kt @@ -135,7 +135,7 @@ class CustomTabBrowserToolbarMiddlewareTest { @Test fun `GIVEN the custom tab is configured to show a custom close button WHEN initializing the toolbar THEN add a close button with a custom icon`() { every { customTab.config.showCloseButton } returns true - val closeButtonIcon: Bitmap = testContext.getDrawable(R.drawable.ic_back_button)!!.toBitmap(10, 10) + val closeButtonIcon: Bitmap = testContext.getDrawable(iconsR.drawable.mozac_ic_back_24)!!.toBitmap(10, 10) every { customTab.config.closeButtonIcon } returns closeButtonIcon val expectedCloseButton = ActionButton( drawable = closeButtonIcon.toDrawable(testContext.resources),