commit 403a7182871a775f30909e5a92e93a6d7e48a5e9 parent fcaecb7d09265efe1a9fd7f70379a319344e3528 Author: Gabriel Luong <gabriel.luong@gmail.com> Date: Fri, 21 Nov 2025 20:32:05 +0000 Bug 1993368 - Part 3: Change the Homepage background color to use Material3 surface color token r=android-reviewers,007 Differential Revision: https://phabricator.services.mozilla.com/D268165 Diffstat:
5 files changed, 4 insertions(+), 27 deletions(-)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt @@ -1203,7 +1203,9 @@ class HomeFragment : Fragment() { override fun onResume() { super.onResume() if (browsingModeManager.mode == BrowsingMode.Private) { - activity?.window?.setBackgroundDrawableResource(R.drawable.private_home_background_gradient) + activity?.window?.setBackgroundDrawable( + getColor(requireContext(), R.color.fx_mobile_private_surface).toDrawable(), + ) } hideToolbar() @@ -1249,11 +1251,6 @@ class HomeFragment : Fragment() { override fun onPause() { super.onPause() - if (browsingModeManager.mode == BrowsingMode.Private) { - activity?.window?.setBackgroundDrawable( - getColor(requireContext(), R.color.fx_mobile_private_layer_color_1).toDrawable(), - ) - } // Counterpart to the update in onResume to keep the last access timestamp of the selected // tab up-to-date. diff --git a/mobile/android/fenix/app/src/main/res/drawable/private_home_background_gradient.xml b/mobile/android/fenix/app/src/main/res/drawable/private_home_background_gradient.xml @@ -1,16 +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/. --> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item> - <shape> - <gradient - android:angle="45" - android:startColor="@color/fx_mobile_private_layer_color_4_start" - android:centerColor="@color/fx_mobile_private_layer_color_4_center" - android:endColor="@color/fx_mobile_private_layer_color_4_end" - android:type="linear" /> - </shape> - </item> -</selector> diff --git a/mobile/android/fenix/app/src/main/res/layout/fragment_home.xml b/mobile/android/fenix/app/src/main/res/layout/fragment_home.xml @@ -12,8 +12,7 @@ xmlns:tools="http://schemas.android.com/tools" android:id="@+id/homeLayout" android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="?homeBackground"> + android:layout_height="match_parent"> <androidx.appcompat.widget.AppCompatImageView android:id="@+id/wallpaperImageView" diff --git a/mobile/android/fenix/app/src/main/res/values/attrs.xml b/mobile/android/fenix/app/src/main/res/values/attrs.xml @@ -70,7 +70,6 @@ <attr name="menuItemButtonTintColor" format="reference"/> <!-- Misc --> - <attr name="homeBackground" format="reference"/> <attr name="bottomBarBackground" format="reference"/> <attr name="bottomBarBackgroundTop" format="reference"/> <attr name="fenixLogo" format="reference" /> diff --git a/mobile/android/fenix/app/src/main/res/values/styles.xml b/mobile/android/fenix/app/src/main/res/values/styles.xml @@ -187,7 +187,6 @@ <item name="fenixLogo">@drawable/ic_logo_wordmark_normal</item> <item name="fenixWordmarkText">@drawable/ic_wordmark_text_normal</item> <item name="fenixWordmarkLogo">@drawable/ic_wordmark_logo</item> - <item name="homeBackground">@color/fx_mobile_layer_color_1</item> <item name="bottomBarBackground">@drawable/home_bottom_bar_background</item> <item name="bottomBarBackgroundTop">@drawable/home_bottom_bar_background_top</item> <item name="mozac_ic_private_mode_circle_fill_background_color">@android:color/transparent</item> @@ -485,7 +484,6 @@ <item name="fenixLogo">@drawable/ic_logo_wordmark_private</item> <item name="fenixWordmarkText">@drawable/ic_wordmark_text_private</item> <item name="fenixWordmarkLogo">@drawable/ic_wordmark_logo</item> - <item name="homeBackground">@drawable/private_home_background_gradient</item> <item name="bottomBarBackground">@drawable/private_home_bottom_bar_background_gradient</item> <item name="bottomBarBackgroundTop">@drawable/private_home_bottom_bar_background_gradient_top</item> <item name="mozac_ic_private_mode_circle_fill_background_color">@color/photonWhite</item>