[Android] Add new shuffle icon

Alexandre Perraud git at videolan.org
Tue Nov 2 13:00:50 UTC 2021


vlc-android | branch: master | Alexandre Perraud <alexandre at videolan.org> | Mon Sep 20 16:00:56 2021 +0200| [1e7761ac423db14d430184209cdcf41a09c889d7] | committer: Nicolas Pomepuy

Add new shuffle icon

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

 .../resources/src/main/res/drawable/ic_shuffle_48dp.xml     | 13 +++++++++++++
 .../resources/src/main/res/drawable/ic_shuffle_on_48dp.xml  | 11 +++++++++++
 .../org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt   |  6 +++---
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/application/resources/src/main/res/drawable/ic_shuffle_48dp.xml b/application/resources/src/main/res/drawable/ic_shuffle_48dp.xml
new file mode 100644
index 000000000..0914dd41f
--- /dev/null
+++ b/application/resources/src/main/res/drawable/ic_shuffle_48dp.xml
@@ -0,0 +1,13 @@
+<!--From Google Fonts shuffle_black_48dp.svg-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:width="48dp"
+    android:height="48dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M10.59,9.17L6.12,4.7c-0.39,-0.39 -1.02,-0.39 -1.41,0 -0.39,0.39 -0.39,1.02 0,1.41l4.46,4.46 1.42,-1.4zM15.35,4.85l1.19,1.19L4.7,17.88c-0.39,0.39 -0.39,1.02 0,1.41 0.39,0.39 1.02,0.39 1.41,0L17.96,7.46l1.19,1.19c0.31,0.31 0.85,0.09 0.85,-0.36L20,4.5c0,-0.28 -0.22,-0.5 -0.5,-0.5h-3.79c-0.45,0 -0.67,0.54 -0.36,0.85zM14.83,13.41l-1.41,1.41 3.13,3.13 -1.2,1.2c-0.31,0.31 -0.09,0.85 0.36,0.85h3.79c0.28,0 0.5,-0.22 0.5,-0.5v-3.79c0,-0.45 -0.54,-0.67 -0.85,-0.35l-1.19,1.19 -3.13,-3.14z"
+      tools:fillColor="#ffffff"
+      android:fillColor="?attr/player_icon_color"/>
+</vector>
diff --git a/application/resources/src/main/res/drawable/ic_shuffle_on_48dp.xml b/application/resources/src/main/res/drawable/ic_shuffle_on_48dp.xml
new file mode 100644
index 000000000..a27a5ce35
--- /dev/null
+++ b/application/resources/src/main/res/drawable/ic_shuffle_on_48dp.xml
@@ -0,0 +1,11 @@
+<!--From Google Fonts shuffle_black_48dp.svg-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="48dp"
+    android:height="48dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M10.59,9.17L6.12,4.7c-0.39,-0.39 -1.02,-0.39 -1.41,0 -0.39,0.39 -0.39,1.02 0,1.41l4.46,4.46 1.42,-1.4zM15.35,4.85l1.19,1.19L4.7,17.88c-0.39,0.39 -0.39,1.02 0,1.41 0.39,0.39 1.02,0.39 1.41,0L17.96,7.46l1.19,1.19c0.31,0.31 0.85,0.09 0.85,-0.36L20,4.5c0,-0.28 -0.22,-0.5 -0.5,-0.5h-3.79c-0.45,0 -0.67,0.54 -0.36,0.85zM14.83,13.41l-1.41,1.41 3.13,3.13 -1.2,1.2c-0.31,0.31 -0.09,0.85 0.36,0.85h3.79c0.28,0 0.5,-0.22 0.5,-0.5v-3.79c0,-0.45 -0.54,-0.67 -0.85,-0.35l-1.19,1.19 -3.13,-3.14z"
+      android:fillColor="?attr/colorPrimary"/>
+</vector>
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
index 47e8ff4e7..728e4d4ae 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
@@ -107,8 +107,8 @@ class PlayerOptionsDelegate(val activity: FragmentActivity, val service: Playbac
             if (primary && AndroidDevices.pipAllowed && !AndroidDevices.isDex(activity))
                 options.add(PlayerOption(ID_POPUP_VIDEO, R.attr.ic_popup_dim, res.getString(R.string.ctx_pip_title)))
             if (primary)
-            if (service.canShuffle()) options.add(PlayerOption(ID_SHUFFLE, R.drawable.ic_shuffle, res.getString(R.string.shuffle_title)))
                 options.add(PlayerOption(ID_REPEAT, R.drawable.ic_repeat_48dp, res.getString(R.string.repeat_title)))
+            if (service.canShuffle()) options.add(PlayerOption(ID_SHUFFLE, R.drawable.ic_shuffle_48dp, res.getString(R.string.shuffle_title)))
             options.add(PlayerOption(ID_VIDEO_STATS, R.attr.ic_video_stats, res.getString(R.string.video_information)))
         }
         val chaptersCount = service.getChapters(-1)?.size ?: 0
@@ -297,13 +297,13 @@ class PlayerOptionsDelegate(val activity: FragmentActivity, val service: Playbac
     }
 
     private fun setShuffle() {
-        shuffleBinding.optionIcon.setImageResource(if (service.isShuffling) R.drawable.ic_shuffle_on else R.drawable.ic_shuffle)
+        shuffleBinding.optionIcon.setImageResource(if (service.isShuffling) R.drawable.ic_shuffle_on_48dp else R.drawable.ic_shuffle_48dp)
     }
 
     private fun initShuffle(binding: PlayerOptionItemBinding) {
         shuffleBinding = binding
         AppScope.launch(Dispatchers.Main) {
-            shuffleBinding.optionIcon.setImageResource(if (service.isShuffling) R.drawable.ic_shuffle_on else R.drawable.ic_shuffle)
+            shuffleBinding.optionIcon.setImageResource(if (service.isShuffling) R.drawable.ic_shuffle_on_48dp else R.drawable.ic_shuffle_48dp)
         }
     }
 



More information about the Android mailing list