tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 654474dd66681580ce45080213360a5f52d8b2e5
parent 97e20b0d22778c11dac1fb25e3aed85804488268
Author: Gabriel Luong <gabriel.luong@gmail.com>
Date:   Wed, 10 Dec 2025 15:33:11 +0000

Bug 2004511 - Part 21: Migrate the account preference to use M3 color tokens r=android-reviewers,007

- Migrated the Account Preference in the main screen of Settings to use M3 color tokens. This is displayed when an user is signed into FxA at top of the screen.
- Removed ic_account drawable since the path displayed the account icon at the top left aligned instead of centered.

Differential Revision: https://phabricator.services.mozilla.com/D275404

Diffstat:
Mmobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/account/AccountUiView.kt | 3++-
Dmobile/android/fenix/app/src/main/res/drawable/ic_account.xml | 12------------
Mmobile/android/fenix/app/src/main/res/layout/account_preference.xml | 4++--
Mmobile/android/fenix/app/src/main/res/xml/preferences.xml | 2+-
4 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/account/AccountUiView.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/account/AccountUiView.kt @@ -20,6 +20,7 @@ import mozilla.components.service.fxa.manager.FxaAccountManager import org.mozilla.fenix.R import org.mozilla.fenix.ext.bitmapForUrl import org.mozilla.fenix.settings.requirePreference +import mozilla.components.ui.icons.R as iconsR class AccountUiView( fragment: PreferenceFragmentCompat, @@ -101,7 +102,7 @@ class AccountUiView( * Returns generic avatar for accounts. */ private fun genericAvatar(context: Context) = - AppCompatResources.getDrawable(context, R.drawable.ic_account) + AppCompatResources.getDrawable(context, iconsR.drawable.mozac_ic_avatar_circle_24) /** * Gets a rounded drawable from a URL if possible, else null. diff --git a/mobile/android/fenix/app/src/main/res/drawable/ic_account.xml b/mobile/android/fenix/app/src/main/res/drawable/ic_account.xml @@ -1,12 +0,0 @@ -<!-- 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:viewportWidth="24" - android:viewportHeight="24"> - <path - android:pathData="m10,20c-5.5228,0 -10,-4.4772 -10,-10s4.4772,-10 10,-10 10,4.4772 10,10c-0.0061,5.5203 -4.4797,9.9939 -10,10zM10,2c-4.4183,0 -8,3.5817 -8,8s3.5817,8 8,8 8,-3.5817 8,-8c-0.005,-4.4162 -3.5838,-7.995 -8,-8zM15.6655,12.2092c-1.4812,-1.7094 -3.5322,0.5908 -5.6658,0.5908 -2.1322,0 -4.1846,-2.3002 -5.6658,-0.5908 -0.42,0.4844 -0.4536,1.19 -0.0938,1.7192 1.2558,1.848 3.3558,3.0716 5.7596,3.0716 2.4038,0 4.5038,-1.2236 5.7596,-3.0716 0.3612,-0.5292 0.3262,-1.2348 -0.0938,-1.7192m-5.6655,-0.7092c2.3474,0 4.25,-1.9026 4.25,-4.25 0,-2.3474 -1.9026,-4.25 -4.25,-4.25 -2.3474,0 -4.25,1.9026 -4.25,4.25 0,2.3474 1.9026,4.25 4.25,4.25" - android:fillColor="?attr/textPrimary"/> -</vector> diff --git a/mobile/android/fenix/app/src/main/res/layout/account_preference.xml b/mobile/android/fenix/app/src/main/res/layout/account_preference.xml @@ -36,7 +36,7 @@ android:layout_height="wrap_content" android:ellipsize="marquee" android:fadingEdge="horizontal" - android:textColor="?attr/textPrimary" + android:textColor="?attr/colorOnSurface" android:textSize="16sp" android:visibility="gone" /> @@ -46,7 +46,7 @@ android:layout_height="wrap_content" android:layout_below="@id/displayName" android:layout_alignStart="@id/displayName" - android:textColor="?attr/textSecondary" + android:textColor="?attr/colorOnSurfaceVariant" android:maxLines="4" android:text="@string/preferences_account_default_name_2" /> diff --git a/mobile/android/fenix/app/src/main/res/xml/preferences.xml b/mobile/android/fenix/app/src/main/res/xml/preferences.xml @@ -20,7 +20,7 @@ android:layout="@layout/preference_category_no_icon_style"> <org.mozilla.fenix.settings.account.AccountPreference - android:icon="@drawable/ic_account" + android:icon="@drawable/mozac_ic_avatar_circle_24" android:key="@string/pref_key_account" /> <org.mozilla.fenix.settings.account.AccountAuthErrorPreference