tor-browser

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

commit 1c3266aba7b5d77f76185d8706cfeff7751066a8
parent aa08ba558fdd8bf219d1692ef5425f1441bd6101
Author: Gabriel Luong <gabriel.luong@gmail.com>
Date:   Wed, 17 Dec 2025 07:03:03 +0000

Bug 2005850 - Part 3: Use the correct icons for reader mode in the toolbar r=android-reviewers,petru

- Aligns the reader mode icons for inactive and active state to the Figma https://www.figma.com/design/MjufE1X5fvkxZ0YneX4kRd/Android-Library--2025-?node-id=68321-65491&m=dev
- Removes the old icon usages and clean up the Acorn color usage

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

Diffstat:
Mmobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt | 7+++----
Mmobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarMiddleware.kt | 6+++++-
Dmobile/android/fenix/app/src/main/res/drawable/ic_readermode.xml | 16----------------
Dmobile/android/fenix/app/src/main/res/drawable/ic_readermode_selected.xml | 37-------------------------------------
Mmobile/android/fenix/app/src/main/res/values-night/colors.xml | 4----
Mmobile/android/fenix/app/src/main/res/values/colors.xml | 4----
Mmobile/android/fenix/app/src/test/java/org/mozilla/fenix/components/toolbar/BrowserToolbarMiddlewareTest.kt | 8++++++--
7 files changed, 14 insertions(+), 68 deletions(-)

diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt @@ -323,12 +323,11 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler { val readerModeAction = BrowserToolbar.ToggleButton( image = AppCompatResources.getDrawable( context, - R.drawable.ic_readermode, + iconsR.drawable.mozac_ic_reader_view_24, )!!, - imageSelected = - AppCompatResources.getDrawable( + imageSelected = AppCompatResources.getDrawable( context, - R.drawable.ic_readermode_selected, + iconsR.drawable.mozac_ic_reader_view_fill_24, )!!, contentDescription = context.getString(R.string.browser_menu_read), contentDescriptionSelected = context.getString(R.string.browser_menu_read_close), diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarMiddleware.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarMiddleware.kt @@ -1165,7 +1165,11 @@ class BrowserToolbarMiddleware( ) ToolbarAction.ReaderMode -> ActionButtonRes( - drawableResId = R.drawable.ic_readermode, + drawableResId = if (browserScreenStore.state.readerModeStatus.isActive) { + iconsR.drawable.mozac_ic_reader_view_fill_24 + } else { + iconsR.drawable.mozac_ic_reader_view_24 + }, contentDescription = if (browserScreenStore.state.readerModeStatus.isActive) { R.string.browser_menu_read_close } else { diff --git a/mobile/android/fenix/app/src/main/res/drawable/ic_readermode.xml b/mobile/android/fenix/app/src/main/res/drawable/ic_readermode.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/. --> -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="24dp" - android:height="24dp" - android:viewportWidth="24" - android:viewportHeight="24"> - <path - android:fillColor="?attr/textPrimary" - android:pathData="M6.5 3A2.5 2.5 0 0 0 4 5.5v13A2.5 2.5 0 0 0 6.5 21h11a2.5 2.5 0 0 0 2.5-2.5v-13A2.5 2.5 0 0 0 17.5 3h-11zm12 15.7l-0.8 0.8H6.3l-0.8-0.8V5.3l0.8-0.8h11.4l0.8 0.8v13.4z" /> - <path - android:fillColor="?attr/textPrimary" - android:pathData="M15.25 8.5h-6.5a0.75 0.75 0 0 1 0-1.5h6.5a0.75 0.75 0 0 1 0 1.5zm0 4h-6.5a0.75 0.75 0 0 1 0-1.5h6.5a0.75 0.75 0 0 1 0 1.5zm-3 4h-3.5a0.75 0.75 0 0 1 0-1.5h3.5a0.75 0.75 0 0 1 0 1.5z" /> -</vector> diff --git a/mobile/android/fenix/app/src/main/res/drawable/ic_readermode_selected.xml b/mobile/android/fenix/app/src/main/res/drawable/ic_readermode_selected.xml @@ -1,37 +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" - xmlns:aapt="http://schemas.android.com/aapt" - android:width="24dp" - android:height="24dp" - android:viewportWidth="24" - android:viewportHeight="24"> - <path - android:pathData="M6.5 3A2.5 2.5 0 0 0 4 5.5v13A2.5 2.5 0 0 0 6.5 21h11a2.5 2.5 0 0 0 2.5-2.5v-13A2.5 2.5 0 0 0 17.5 3h-11zm12 15.7l-0.8 0.8H6.3l-0.8-0.8V5.3l0.8-0.8h11.4l0.8 0.8v13.4z" > - <aapt:attr name="android:fillColor"> - <gradient - android:type="linear" - android:startX="24" - android:startY="0" - android:endX="0" - android:endY="24" - android:startColor="@color/fx_mobile_icon_color_gradient_start" - android:endColor="@color/fx_mobile_icon_color_gradient_end"/> - </aapt:attr> - </path> - <path - android:pathData="M15.25 8.5h-6.5a0.75 0.75 0 0 1 0-1.5h6.5a0.75 0.75 0 0 1 0 1.5zm0 4h-6.5a0.75 0.75 0 0 1 0-1.5h6.5a0.75 0.75 0 0 1 0 1.5zm-3 4h-3.5a0.75 0.75 0 0 1 0-1.5h3.5a0.75 0.75 0 0 1 0 1.5z" > - <aapt:attr name="android:fillColor"> - <gradient - android:type="linear" - android:startX="24" - android:startY="0" - android:endX="0" - android:endY="24" - android:startColor="@color/fx_mobile_icon_color_gradient_start" - android:endColor="@color/fx_mobile_icon_color_gradient_end"/> - </aapt:attr> - </path> -</vector> diff --git a/mobile/android/fenix/app/src/main/res/values-night/colors.xml b/mobile/android/fenix/app/src/main/res/values-night/colors.xml @@ -120,10 +120,6 @@ <color name="fx_mobile_icon_color_accent_yellow">@color/photonYellow20</color> <!-- Action Secondary Icon --> <color name="fx_mobile_icon_color_action_secondary">@color/photonLightGrey05</color> - <!-- Reader, ETP Shield --> - <color name="fx_mobile_icon_color_gradient_start">@color/photonViolet20</color> - <!-- Reader, ETP Shield --> - <color name="fx_mobile_icon_color_gradient_end">@color/photonBlue20</color> <!-- Border --> <!-- Active tab (Nav), Selected tab, Active form --> diff --git a/mobile/android/fenix/app/src/main/res/values/colors.xml b/mobile/android/fenix/app/src/main/res/values/colors.xml @@ -120,10 +120,6 @@ <color name="fx_mobile_icon_color_accent_yellow">@color/photonYellow60</color> <!-- Action Secondary Icon --> <color name="fx_mobile_icon_color_action_secondary">@color/photonDarkGrey90</color> - <!-- Reader, ETP Shield --> - <color name="fx_mobile_icon_color_gradient_start">@color/photonViolet50</color> - <!-- Reader, ETP Shield --> - <color name="fx_mobile_icon_color_gradient_end">@color/photonBlue60</color> <!-- Border --> <!-- Active tab (Nav), Selected tab, Active form --> diff --git a/mobile/android/fenix/app/src/test/java/org/mozilla/fenix/components/toolbar/BrowserToolbarMiddlewareTest.kt b/mobile/android/fenix/app/src/test/java/org/mozilla/fenix/components/toolbar/BrowserToolbarMiddlewareTest.kt @@ -2269,7 +2269,7 @@ class BrowserToolbarMiddlewareTest { toolbarAction = ToolbarAction.ReaderMode, ) as ActionButtonRes - assertEquals(R.drawable.ic_readermode, result.drawableResId) + assertEquals(iconsR.drawable.mozac_ic_reader_view_24, result.drawableResId) assertEquals(R.string.browser_menu_read, result.contentDescription) assertEquals(ActionButton.State.DEFAULT, result.state) assertEquals(ReaderModeClicked(false), result.onClick) @@ -2289,6 +2289,7 @@ class BrowserToolbarMiddlewareTest { toolbarAction = ToolbarAction.ReaderMode, ) as ActionButtonRes + assertEquals(iconsR.drawable.mozac_ic_reader_view_fill_24, result.drawableResId) assertEquals(R.string.browser_menu_read_close, result.contentDescription) assertEquals(ActionButton.State.ACTIVE, result.state) assertEquals(ReaderModeClicked(true), result.onClick) @@ -3083,7 +3084,10 @@ class BrowserToolbarMiddlewareTest { ) private fun expectedReaderModeButton(isActive: Boolean = false) = ActionButtonRes( - drawableResId = R.drawable.ic_readermode, + drawableResId = when (isActive) { + true -> iconsR.drawable.mozac_ic_reader_view_fill_24 + false -> iconsR.drawable.mozac_ic_reader_view_24 + }, contentDescription = when (isActive) { true -> R.string.browser_menu_read_close false -> R.string.browser_menu_read