commit cde214eee7e361af6f55816e3043ab13d9d1a6e1 parent 5b672c8037ef884687257924dc1e9792a635fb58 Author: mcarare <48995920+mcarare@users.noreply.github.com> Date: Fri, 17 Oct 2025 12:44:28 +0000 Bug 1994480 - Migrate Focus icons to mozac-icons. r=android-reviewers,avirvara This patch replaces several locally defined icons in Focus for Android with their equivalents from the `components-ui-icons` library. The following icons were migrated: - `ic_autoplay_enabled` - `ic_camera_enabled` - `ic_cookies_disable` - `ic_fingerprint` - `ic_link` - `ic_reorder` - `ic_tab_new` Differential Revision: https://phabricator.services.mozilla.com/D268872 Diffstat:
14 files changed, 15 insertions(+), 121 deletions(-)
diff --git a/mobile/android/focus-android/app/src/main/java/org/mozilla/focus/biometrics/BiometricAuthenticationFragmentCompose.kt b/mobile/android/focus-android/app/src/main/java/org/mozilla/focus/biometrics/BiometricAuthenticationFragmentCompose.kt @@ -28,6 +28,7 @@ import org.mozilla.focus.R import org.mozilla.focus.ui.theme.FocusTheme import org.mozilla.focus.ui.theme.focusTypography import org.mozilla.focus.ui.theme.gradientBackground +import mozilla.components.ui.icons.R as iconsR @Composable @Preview @@ -79,7 +80,7 @@ private fun ComponentShowBiometricPromptButton(showBiometricPrompt: () -> Unit) .fillMaxWidth(), ) { Image( - painter = painterResource(R.drawable.ic_fingerprint), + painter = painterResource(iconsR.drawable.mozac_ic_fingerprinter_24), contentDescription = stringResource(R.string.biometric_auth_image_description), modifier = Modifier.padding(end = 10.dp), ) diff --git a/mobile/android/focus-android/app/src/main/java/org/mozilla/focus/cookiebannerreducer/CookieBannerReducerItem.kt b/mobile/android/focus-android/app/src/main/java/org/mozilla/focus/cookiebannerreducer/CookieBannerReducerItem.kt @@ -105,7 +105,7 @@ fun CookieBannerReducerItem( if (cookieBannerReducerStatus is CookieBannerReducerStatus.NoException) { painterResource(id = iconsR.drawable.mozac_ic_cookies_24) } else { - painterResource(id = R.drawable.ic_cookies_disable) + painterResource(id = iconsR.drawable.mozac_ic_cookies_slash_24) } Icon( painter = painter, diff --git a/mobile/android/focus-android/app/src/main/java/org/mozilla/focus/session/ui/TabViewHolder.kt b/mobile/android/focus-android/app/src/main/java/org/mozilla/focus/session/ui/TabViewHolder.kt @@ -13,6 +13,7 @@ import org.mozilla.focus.R import org.mozilla.focus.databinding.ItemSessionBinding import org.mozilla.focus.ext.beautifyUrl import java.lang.ref.WeakReference +import mozilla.components.ui.icons.R as iconsR class TabViewHolder( private val binding: ItemSessionBinding, @@ -70,7 +71,7 @@ class TabViewHolder( binding.sessionItem.setBackgroundResource(drawable) binding.sessionTitle.apply { - setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_link, 0, 0, 0) + setCompoundDrawablesWithIntrinsicBounds(iconsR.drawable.mozac_ic_link_24, 0, 0, 0) text = title setOnClickListener { val clickedTab = tabReference.get() ?: return@setOnClickListener @@ -97,7 +98,7 @@ class TabViewHolder( binding.sessionItem.setBackgroundResource(drawable) val drawableWidth = - AppCompatResources.getDrawable(binding.root.context, R.drawable.ic_link)?.intrinsicWidth ?: 0 + AppCompatResources.getDrawable(binding.root.context, iconsR.drawable.mozac_ic_link_24)?.intrinsicWidth ?: 0 binding.sessionTitle.apply { text = binding.root.context.getString(R.string.tabs_tray_action_erase_other) diff --git a/mobile/android/focus-android/app/src/main/res/drawable/ic_autoplay_enabled.xml b/mobile/android/focus-android/app/src/main/res/drawable/ic_autoplay_enabled.xml @@ -1,17 +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="?primaryText" - android:pathData="M18.918 5.282A9.442 9.442 0 0 0 12.2 2.5a0.75 0.75 0 0 0 0 1.5c2.137 0 4.146 0.832 5.657 2.343A7.948 7.948 0 0 1 20.2 12c0 4.411-3.589 8-8 8s-8-3.589-8-8c0-1.427 0.393-2.806 1.107-4.026l1.61 1.61A0.635 0.635 0 0 0 8 9.135V4.364L7.636 4H2.865a0.635 0.635 0 0 0-0.449 1.083l1.789 1.789A9.472 9.472 0 0 0 2.7 12c0 5.238 4.262 9.5 9.5 9.5s9.5-4.262 9.5-9.5a9.442 9.442 0 0 0-2.782-6.718z" /> - <path - android:fillColor="?primaryText" - android:pathData="M9.5 15.554V8.446a0.89 0.89 0 0 1 1.33-0.772l6.222 3.554a0.889 0.889 0 0 1 0 1.543l-6.222 3.554a0.888 0.888 0 0 1-1.33-0.771z" /> -</vector> diff --git a/mobile/android/focus-android/app/src/main/res/drawable/ic_camera_enabled.xml b/mobile/android/focus-android/app/src/main/res/drawable/ic_camera_enabled.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:viewportWidth="24" - android:viewportHeight="24"> - <path - android:name="icon" - android:fillColor="?primaryText" - android:pathData="M19.482 5.531c-0.614 0-1.24 0.228-1.75 0.737L17 7a2.5 2.5 0 0 0-2.5-2.5h-9A2.5 2.5 0 0 0 3 7v10a2.5 2.5 0 0 0 2.5 2.5h9A2.5 2.5 0 0 0 17 17l0.732 0.732a2.448 2.448 0 0 0 1.75 0.737c1.285 0 2.518-0.998 2.518-2.505V8.036c0-1.507-1.233-2.505-2.518-2.505zM20.5 15.964c0 0.693-0.595 1.005-1.018 1.005-0.26 0-0.491-0.1-0.689-0.298l-2.496-2.497H15.5V17.2L14.7 18H5.3l-0.8-0.8V6.8L5.3 6h9.4l0.8 0.8v3.025h0.796l2.496-2.497a0.949 0.949 0 0 1 0.689-0.298c0.423 0 1.018 0.312 1.018 1.005v7.929H20.5z" /> -</vector> diff --git a/mobile/android/focus-android/app/src/main/res/drawable/ic_cookies_disable.xml b/mobile/android/focus-android/app/src/main/res/drawable/ic_cookies_disable.xml @@ -1,13 +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" xmlns:aapt="http://schemas.android.com/aapt" - android:viewportWidth="24" - android:viewportHeight="24" - android:width="24dp" - android:height="24dp"> - <path - android:pathData="M6.99998 6.00006V6.40406L5.55798 4.96206C6.90298 3.72306 8.60098 2.86106 10.489 2.56006L11.054 3.05806C11.022 3.34406 10.999 3.63306 10.999 3.92806C10.999 7.47406 13.307 10.4771 16.5 11.5291V12.7511L17 13.2511H18.5L19 12.7511V11.9341H19.006C19.649 11.9341 20.264 11.8331 20.862 11.6891L21.492 12.2441C21.416 14.6101 20.47 16.7521 18.972 18.3761L13.25 12.6541V11.2501L12.75 10.7501H11.346L8.59598 8.00006H8.99998L9.49998 7.50006V6.00006L8.99998 5.50006H7.49998L6.99998 6.00006ZM18.159 21.7801C18.305 21.9261 18.497 22.0001 18.689 22.0001C18.881 22.0001 19.073 21.9271 19.219 21.7801C19.512 21.4871 19.512 21.0121 19.219 20.7191L3.13402 4.63406C2.84102 4.34106 2.36602 4.34106 2.07302 4.63406C1.78002 4.92706 1.78002 5.40206 2.07302 5.69506L3.69672 7.31866C2.93108 8.68361 2.49194 10.2558 2.49194 11.9341C2.49194 17.1851 6.74894 21.4421 11.9999 21.4421C13.6787 21.4421 15.253 21.005 16.6194 20.2406L18.159 21.7801ZM4.99994 12.7501V11.2501L5.49994 10.7501H6.99994L7.49994 11.2501V12.7501L6.99994 13.2501H5.49994L4.99994 12.7501ZM9.49994 18.0001L8.99994 18.5001H7.49994L6.99994 18.0001V16.5001L7.49994 16.0001H8.99994L9.49994 16.5001V18.0001Z" - android:fillColor="@color/mozac_ui_icons_fill" /> -</vector> diff --git a/mobile/android/focus-android/app/src/main/res/drawable/ic_fingerprint.xml b/mobile/android/focus-android/app/src/main/res/drawable/ic_fingerprint.xml @@ -1,14 +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="21dp" - android:height="20dp" - android:viewportWidth="21" - android:viewportHeight="20"> - <path - android:pathData="M15.171,18.905C15.309,19.012 15.472,19.065 15.634,19.065C15.857,19.065 16.077,18.967 16.224,18.779C22.187,11.194 20.62,6.279 19.155,4.025C17.121,0.892 12.879,-0.683 9.073,0.282C5.405,1.21 3.014,4.251 2.677,8.417C2.644,8.83 2.952,9.192 3.365,9.226C3.765,9.238 4.14,8.951 4.174,8.538C4.46,4.989 6.38,2.511 9.442,1.736C12.644,0.92 16.202,2.232 17.898,4.842C19.144,6.76 20.431,11.001 15.045,17.851C14.789,18.177 14.846,18.649 15.171,18.905ZM7.66,19.722C7.33,19.722 7.028,19.503 6.936,19.17C6.827,18.771 7.062,18.358 7.461,18.248C14.876,16.217 15.19,8.71 15.2,8.392C15.454,6.774 14.228,5.308 12.478,5.027C10.739,4.75 9.104,5.753 8.86,7.274L8.589,8.789C8.203,10.944 6.334,12.508 4.145,12.508H1.25C0.836,12.508 0.5,12.172 0.5,11.758C0.5,11.344 0.836,11.008 1.25,11.008H4.146C5.608,11.008 6.856,9.964 7.114,8.526L7.383,7.024C7.757,4.701 10.149,3.129 12.718,3.547C15.284,3.959 17.068,6.196 16.692,8.533C16.699,8.533 16.357,17.368 7.859,19.696C7.792,19.713 7.726,19.722 7.66,19.722ZM5.188,16H1.25C0.836,16 0.5,15.664 0.5,15.25C0.5,14.836 0.836,14.5 1.25,14.5H5.188C8.58,14.5 11.338,11.74 11.338,8.349V7.722C11.338,7.308 11.674,6.972 12.088,6.972C12.502,6.972 12.838,7.308 12.838,7.722V8.349C12.839,12.567 9.407,16 5.188,16Z" - android:fillColor="#FBFBFE" - android:fillType="evenOdd"/> -</vector> diff --git a/mobile/android/focus-android/app/src/main/res/drawable/ic_link.xml b/mobile/android/focus-android/app/src/main/res/drawable/ic_link.xml @@ -1,22 +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="@color/primaryText" - android:pathData="M4.47,7.53,7.515,4.485a0.685 0.685 -,0,0,1,0.969,0l4.2,4.2A2.485,2.485,0,0,0,12.5,5.395l-2.66-2.66a2.494,2.494,0,0,0-3.527,0L2.766,6.279a2.494,2.494,0,0,0,0,3.527l2.66,2.66a2.487,2.487,0,0,0,3.242 -0.232 L4.47,8.5A0.685 0.685 -,0,0,1,4.47,7.53Zm16.8,6.633-2.66-2.66a2.485,2.485,0,0,0-3.293-0.191l4.2,4.2a0.685 -0.685 ,0,0,1,0,0.969L16.47,19.53a0.685 0.685 -,0,0,1-0.969,0l-4.2-4.2a2.487,2.487,0,0,0,0.232,3.242l2.66,2.66a2.494,2.494,0,0,0,3.527,0l3.544-3.544A2.494,2.494,0,0,0,21.266,14.163Z" /> - <path - android:fillColor="@color/primaryText" - android:pathData="M16.163,14.718,9.243,7.8A1,1,0,1,0,7.829,9.212l6.92,6.92a1,1,0,0,0,1.414-1.414Z" /> -</vector> -\ No newline at end of file diff --git a/mobile/android/focus-android/app/src/main/res/drawable/ic_reorder.xml b/mobile/android/focus-android/app/src/main/res/drawable/ic_reorder.xml @@ -1,13 +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.0" - android:viewportHeight="24.0"> - <path - android:pathData="M3,15h18v-2L3,13v2zM3,19h18v-2L3,17v2zM3,11h18L21,9L3,9v2zM3,5v2h18L21,5L3,5z" - android:fillColor="@color/primaryText"/> -</vector> diff --git a/mobile/android/focus-android/app/src/main/res/drawable/ic_tab_new.xml b/mobile/android/focus-android/app/src/main/res/drawable/ic_tab_new.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:viewportWidth="24" - android:viewportHeight="24"> - <path - android:pathData="m15,14v-2c0,-0.5523 0.4477,-1 1,-1h1c0.5523,0 1,0.4477 1,1v-4c0,-1.1046 -0.8954,-2 -2,-2h-8c-1.1046,0 -2,0.8954 -2,2v6h-1c-0.5523,0 -1,0.4477 -1,1s0.4477,1 1,1h7v-1c0,-0.5523 0.4477,-1 1,-1zM19.5,15h-2.5v-2.5c0,-0.2761 -0.2239,-0.5 -0.5,-0.5s-0.5,0.2239 -0.5,0.5v2.5h-2.5c-0.2761,0 -0.5,0.2239 -0.5,0.5s0.2239,0.5 0.5,0.5h2.5v2.5c0,0.2761 0.2239,0.5 0.5,0.5s0.5,-0.2239 0.5,-0.5v-2.5h2.5c0.2761,0 0.5,-0.2239 0.5,-0.5s-0.2239,-0.5 -0.5,-0.5z" - android:fillColor="@color/primaryText" - android:fillAlpha=".8"/> -</vector> diff --git a/mobile/android/focus-android/app/src/main/res/layout/item_custom_domain.xml b/mobile/android/focus-android/app/src/main/res/layout/item_custom_domain.xml @@ -31,7 +31,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - app:srcCompat="@drawable/ic_reorder" + app:srcCompat="@drawable/mozac_ic_reorder" android:importantForAccessibility="no" android:paddingEnd="?android:attr/listPreferredItemPaddingStart" /> <CheckBox diff --git a/mobile/android/focus-android/app/src/main/res/layout/item_session.xml b/mobile/android/focus-android/app/src/main/res/layout/item_session.xml @@ -24,7 +24,7 @@ android:paddingEnd="16dp" android:textColor="@color/primaryText" android:textSize="14sp" - app:drawableStartCompat="@drawable/ic_link" + app:drawableStartCompat="@drawable/mozac_ic_link_24" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@id/close_button" app:layout_constraintStart_toStartOf="parent" diff --git a/mobile/android/focus-android/app/src/main/res/xml/mozilla_settings.xml b/mobile/android/focus-android/app/src/main/res/xml/mozilla_settings.xml @@ -13,25 +13,25 @@ android:title="@string/menu_about" /> <androidx.preference.Preference - android:icon="@drawable/ic_tab_new" + android:icon="@drawable/mozac_ic_tab_new" android:key="@string/pref_key_help" android:layout="@layout/focus_preference_new_tab" android:title="@string/menu_help" /> <androidx.preference.Preference - android:icon="@drawable/ic_tab_new" + android:icon="@drawable/mozac_ic_tab_new" android:key="@string/pref_key_privacy_notice" android:layout="@layout/focus_preference_new_tab" android:title="@string/preference_privacy_notice" /> <androidx.preference.Preference - android:icon="@drawable/ic_tab_new" + android:icon="@drawable/mozac_ic_tab_new" android:key="@string/pref_key_terms_of_use" android:layout="@layout/focus_preference_new_tab" android:title="@string/menu_terms_of_use" /> <androidx.preference.Preference - android:icon="@drawable/ic_tab_new" + android:icon="@drawable/mozac_ic_tab_new" android:key="@string/pref_key_licensing_info" android:layout="@layout/focus_preference_new_tab" android:title="@string/preference_licensing_info" /> diff --git a/mobile/android/focus-android/app/src/main/res/xml/site_permissions.xml b/mobile/android/focus-android/app/src/main/res/xml/site_permissions.xml @@ -4,14 +4,14 @@ <androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <androidx.preference.Preference - android:icon="@drawable/ic_autoplay_enabled" + android:icon="@drawable/mozac_ic_autoplay_24" android:key="@string/pref_key_autoplay" android:layout="@layout/focus_preference_new_tab" android:summary="@string/preference_block_autoplay_audio_video" android:title="@string/preference_autoplay" /> <androidx.preference.Preference - android:icon="@drawable/ic_camera_enabled" + android:icon="@drawable/mozac_ic_camera_24" android:key="@string/pref_key_phone_feature_camera" android:layout="@layout/focus_preference_new_tab" android:summary="@string/preference_option_phone_feature_ask_to_allow" @@ -40,7 +40,7 @@ app:allowDividerBelow="true" /> <androidx.preference.Preference - android:icon="@drawable/ic_link" + android:icon="@drawable/mozac_ic_link_24" android:layout="@layout/focus_preference_new_tab" android:key="@string/pref_key_browser_feature_media_key_system_access" android:summary="@string/preference_option_phone_feature_ask_to_allow"