[Android] Update favorite action mode icons

Alexandre Perraud git at videolan.org
Fri Oct 6 10:20:34 UTC 2023


vlc-android | branch: master | Alexandre Perraud <alexandre at videolan.org> | Fri Sep 15 11:18:37 2023 +0200| [cb57f03e86918f23a1fc5722cbdb7529312d59d1] | committer: Alexandre Perraud

Update favorite action mode icons

> https://code.videolan.org/videolan/vlc-android/commit/cb57f03e86918f23a1fc5722cbdb7529312d59d1
---

 .../org/videolan/vlc/gui/browser/FileBrowserFragmentUITest.kt    | 8 ++++----
 .../res/drawable/{ic_menu_favorite.xml => ic_am_favorite.xml}    | 9 ++++-----
 .../{ic_menu_favorite_outline.xml => ic_am_favorite_outline.xml} | 9 ++++-----
 .../vlc-android/res/layout/header_media_list_activity.xml        | 2 +-
 application/vlc-android/res/menu/action_mode_audio_browser.xml   | 4 ++--
 application/vlc-android/res/menu/fragment_option_network.xml     | 2 +-
 .../src/org/videolan/vlc/gui/browser/FileBrowserFragment.kt      | 4 ++--
 .../src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.kt   | 2 +-
 8 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/application/app/src/androidTest/java/org/videolan/vlc/gui/browser/FileBrowserFragmentUITest.kt b/application/app/src/androidTest/java/org/videolan/vlc/gui/browser/FileBrowserFragmentUITest.kt
index 85fbe0ea4a..6aa4c640b7 100644
--- a/application/app/src/androidTest/java/org/videolan/vlc/gui/browser/FileBrowserFragmentUITest.kt
+++ b/application/app/src/androidTest/java/org/videolan/vlc/gui/browser/FileBrowserFragmentUITest.kt
@@ -391,9 +391,9 @@ class FileBrowserFragmentUITest : BaseUITest() {
         onView(withRecyclerView(R.id.network_list).atPosition(0)).perform(click())
 
         onView(withId(R.id.ml_menu_save))
-                .check(matches(withActionIconDrawable(R.drawable.ic_menu_favorite_outline)))
+                .check(matches(withActionIconDrawable(R.drawable.ic_am_favorite_outline)))
                 .perform(click())
-                .check(matches(withActionIconDrawable(R.drawable.ic_menu_favorite)))
+                .check(matches(withActionIconDrawable(R.drawable.ic_am_favorite)))
 
         onView(isRoot()).perform(pressBack())
         onView(isRoot()).perform(pressBack())
@@ -414,9 +414,9 @@ class FileBrowserFragmentUITest : BaseUITest() {
         onView(withRecyclerView(R.id.network_list).atPosition(3)).perform(click())
 
         onView(withId(R.id.ml_menu_save))
-                .check(matches(withActionIconDrawable(R.drawable.ic_menu_favorite)))
+                .check(matches(withActionIconDrawable(R.drawable.ic_am_favorite)))
                 .perform(click())
-                .check(matches(withActionIconDrawable(R.drawable.ic_menu_favorite_outline)))
+                .check(matches(withActionIconDrawable(R.drawable.ic_am_favorite_outline)))
 
         onView(isRoot()).perform(pressBack())
 
diff --git a/application/resources/src/main/res/drawable/ic_menu_favorite.xml b/application/resources/src/main/res/drawable/ic_am_favorite.xml
similarity index 89%
rename from application/resources/src/main/res/drawable/ic_menu_favorite.xml
rename to application/resources/src/main/res/drawable/ic_am_favorite.xml
index e0119fade7..9b2eebaffe 100644
--- a/application/resources/src/main/res/drawable/ic_menu_favorite.xml
+++ b/application/resources/src/main/res/drawable/ic_am_favorite.xml
@@ -1,6 +1,6 @@
 <!--
   ~ *************************************************************************
-  ~  ic_menu_favorite.xml
+  ~  ic_am_favorite.xml
   ~ **************************************************************************
   ~ Copyright © 2022 VLC authors and VideoLAN
   ~ Author: Nicolas POMEPUY
@@ -23,12 +23,11 @@
   -->
 
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="48dp"
-        android:height="48dp"
+        android:width="24dp"
+        android:height="24dp"
         android:viewportWidth="48"
         android:viewportHeight="48">
     <path
-            android:fillColor="?attr/colorControlNormal"
             android:pathData="m26.218,37.652c-1.249,1.134 -3.172,1.134 -4.421,-0.016L21.617,37.471C12.989,29.665 7.352,24.554 7.566,18.178c0.099,-2.794 1.528,-5.472 3.846,-7.05 4.338,-2.958 9.696,-1.578 12.588,1.808 2.892,-3.385 8.25,-4.782 12.588,-1.808 2.317,1.578 3.747,4.256 3.845,7.05 0.23,6.376 -5.423,11.487 -14.051,19.326z"
-            android:strokeWidth="2" />
+            android:fillColor="?attr/colorControlNormal"/>
 </vector>
diff --git a/application/resources/src/main/res/drawable/ic_menu_favorite_outline.xml b/application/resources/src/main/res/drawable/ic_am_favorite_outline.xml
similarity index 90%
rename from application/resources/src/main/res/drawable/ic_menu_favorite_outline.xml
rename to application/resources/src/main/res/drawable/ic_am_favorite_outline.xml
index 0c212d8d72..f2dc382829 100644
--- a/application/resources/src/main/res/drawable/ic_menu_favorite_outline.xml
+++ b/application/resources/src/main/res/drawable/ic_am_favorite_outline.xml
@@ -1,6 +1,6 @@
 <!--
   ~ *************************************************************************
-  ~  ic_menu_favorite_outline.xml
+  ~  ic_am_favorite_outline.xml
   ~ **************************************************************************
   ~ Copyright © 2022 VLC authors and VideoLAN
   ~ Author: Nicolas POMEPUY
@@ -23,12 +23,11 @@
   -->
 
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="48dp"
-        android:height="48dp"
+        android:width="24dp"
+        android:height="24dp"
         android:viewportWidth="48"
         android:viewportHeight="48">
     <path
-            android:fillColor="?attr/colorControlNormal"
             android:pathData="M31.461,9.5C28.578,9.481 25.808,10.82 24,12.936 21.108,9.55 15.75,8.171 11.412,11.129 9.095,12.707 7.665,15.384 7.566,18.178 7.353,24.554 12.99,29.665 21.617,37.471l0.18,0.164c1.249,1.15 3.173,1.151 4.422,0.018l0.164,-0.148c8.628,-7.839 14.281,-12.95 14.051,-19.326 -0.099,-2.794 -1.529,-5.471 -3.846,-7.049 -1.627,-1.115 -3.397,-1.617 -5.127,-1.629zM17.041,13.5c2.382,0 4.702,1.523 5.522,3.631h2.891C26.257,15.023 28.577,13.5 30.959,13.5c3.093,0 5.414,2.308 5.414,5.385 0,4.446 -4.857,8.83 -12.219,15.461L24,34.5 23.846,34.346C16.484,27.715 11.627,23.331 11.627,18.885 11.627,15.808 13.948,13.5 17.041,13.5Z"
-            android:strokeWidth="2" />
+            android:fillColor="?attr/colorControlNormal"/>
 </vector>
diff --git a/application/vlc-android/res/layout/header_media_list_activity.xml b/application/vlc-android/res/layout/header_media_list_activity.xml
index 3558801e8b..20d12ac2f4 100644
--- a/application/vlc-android/res/layout/header_media_list_activity.xml
+++ b/application/vlc-android/res/layout/header_media_list_activity.xml
@@ -215,7 +215,7 @@
                             android:foreground="?attr/selectableItemBackgroundBorderless"
                             android:contentDescription="@string/favorites_add"
                             android:padding="4dp"
-                            vlc:srcCompat="@drawable/ic_menu_favorite"
+                            vlc:srcCompat="@drawable/ic_am_favorite"
                             vlc:layout_constraintBottom_toBottomOf="@id/play_btn"
                             vlc:layout_constraintStart_toEndOf="@id/btn_shuffle"
                             vlc:layout_constraintTop_toTopOf="@id/play_btn" />
diff --git a/application/vlc-android/res/menu/action_mode_audio_browser.xml b/application/vlc-android/res/menu/action_mode_audio_browser.xml
index cf36d14003..9e7240d455 100644
--- a/application/vlc-android/res/menu/action_mode_audio_browser.xml
+++ b/application/vlc-android/res/menu/action_mode_audio_browser.xml
@@ -19,13 +19,13 @@
     <item
         android:id="@+id/action_mode_favorite_add"
         android:title="@string/favorites_add"
-            android:icon="@drawable/ic_menu_favorite"
+            android:icon="@drawable/ic_am_favorite"
             app:showAsAction="ifRoom" />
 
     <item
         android:id="@+id/action_mode_favorite_remove"
         android:title="@string/favorites_remove"
-            android:icon="@drawable/ic_menu_favorite_outline"
+            android:icon="@drawable/ic_am_favorite_outline"
             app:showAsAction="ifRoom" />
     <item
         android:id="@+id/action_mode_audio_append"
diff --git a/application/vlc-android/res/menu/fragment_option_network.xml b/application/vlc-android/res/menu/fragment_option_network.xml
index 4374283bef..76416874fd 100644
--- a/application/vlc-android/res/menu/fragment_option_network.xml
+++ b/application/vlc-android/res/menu/fragment_option_network.xml
@@ -4,7 +4,7 @@
     <item
         android:orderInCategory="2"
         android:id="@+id/ml_menu_save"
-        android:icon="@drawable/ic_menu_favorite_outline"
+        android:icon="@drawable/ic_am_favorite_outline"
         android:visible="false"
         vlc:showAsAction="always" />
 </menu>
\ No newline at end of file
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.kt
index 589106b56c..0712c0c268 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.kt
@@ -147,9 +147,9 @@ open class FileBrowserFragment : BaseBrowserFragment() {
             val isFavorite = mrl != null && browserFavRepository.browserFavExists(mrl!!.toUri())
 
             item.setIcon(if (isFavorite)
-                R.drawable.ic_menu_favorite
+                R.drawable.ic_am_favorite
             else
-                R.drawable.ic_menu_favorite_outline)
+                R.drawable.ic_am_favorite_outline)
             item.setTitle(if (isFavorite) R.string.favorites_remove else R.string.favorites_add)
         }
     }
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.kt
index 4a1dbc5094..5ce258d777 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.kt
@@ -87,7 +87,7 @@ class NetworkBrowserFragment : BaseBrowserFragment(), IDialogManager {
         item.isVisible = !isRootDirectory
         lifecycleScope.launchWhenStarted {
             val isFavorite = mrl != null && browserFavRepository.browserFavExists(mrl!!.toUri())
-            item.setIcon(if (isFavorite) R.drawable.ic_menu_favorite else R.drawable.ic_menu_favorite_outline)
+            item.setIcon(if (isFavorite) R.drawable.ic_am_favorite else R.drawable.ic_am_favorite_outline)
             item.setTitle(if (isFavorite) R.string.favorites_remove else R.string.favorites_add)
             mrl?.let {
                 val isScanned = withContext(Dispatchers.IO) { MedialibraryUtils.isScanned(it) }



More information about the Android mailing list