[Android] Add new repeat 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 15:59:49 2021 +0200| [c0cab5527e45a24c99b19cc7be3447eafc14cf32] | committer: Nicolas Pomepuy

Add new repeat icon

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

 .../resources/src/main/res/drawable/ic_repeat_48dp.xml   | 13 +++++++++++++
 .../src/main/res/drawable/ic_repeat_all_48dp.xml         | 11 +++++++++++
 .../src/main/res/drawable/ic_repeat_one_48dp.xml         | 13 +++++++++++++
 .../videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt    | 16 ++++++++--------
 4 files changed, 45 insertions(+), 8 deletions(-)

diff --git a/application/resources/src/main/res/drawable/ic_repeat_48dp.xml b/application/resources/src/main/res/drawable/ic_repeat_48dp.xml
new file mode 100644
index 000000000..599e2bc34
--- /dev/null
+++ b/application/resources/src/main/res/drawable/ic_repeat_48dp.xml
@@ -0,0 +1,13 @@
+<!--From Google Fonts repeat_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="M7,7h10v1.79c0,0.45 0.54,0.67 0.85,0.35l2.79,-2.79c0.2,-0.2 0.2,-0.51 0,-0.71l-2.79,-2.79c-0.31,-0.31 -0.85,-0.09 -0.85,0.36L17,5L6,5c-0.55,0 -1,0.45 -1,1v4c0,0.55 0.45,1 1,1s1,-0.45 1,-1L7,7zM17,17L7,17v-1.79c0,-0.45 -0.54,-0.67 -0.85,-0.35l-2.79,2.79c-0.2,0.2 -0.2,0.51 0,0.71l2.79,2.79c0.31,0.31 0.85,0.09 0.85,-0.36L7,19h11c0.55,0 1,-0.45 1,-1v-4c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v3z"
+      tools:fillColor="#ffffff"
+      android:fillColor="?attr/player_icon_color"/>
+</vector>
diff --git a/application/resources/src/main/res/drawable/ic_repeat_all_48dp.xml b/application/resources/src/main/res/drawable/ic_repeat_all_48dp.xml
new file mode 100644
index 000000000..b197b1105
--- /dev/null
+++ b/application/resources/src/main/res/drawable/ic_repeat_all_48dp.xml
@@ -0,0 +1,11 @@
+<!--From Google Fonts repeat_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="M7,7h10v1.79c0,0.45 0.54,0.67 0.85,0.35l2.79,-2.79c0.2,-0.2 0.2,-0.51 0,-0.71l-2.79,-2.79c-0.31,-0.31 -0.85,-0.09 -0.85,0.36L17,5L6,5c-0.55,0 -1,0.45 -1,1v4c0,0.55 0.45,1 1,1s1,-0.45 1,-1L7,7zM17,17L7,17v-1.79c0,-0.45 -0.54,-0.67 -0.85,-0.35l-2.79,2.79c-0.2,0.2 -0.2,0.51 0,0.71l2.79,2.79c0.31,0.31 0.85,0.09 0.85,-0.36L7,19h11c0.55,0 1,-0.45 1,-1v-4c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v3z"
+      android:fillColor="?attr/colorPrimary"/>
+</vector>
diff --git a/application/resources/src/main/res/drawable/ic_repeat_one_48dp.xml b/application/resources/src/main/res/drawable/ic_repeat_one_48dp.xml
new file mode 100644
index 000000000..dba5f4f77
--- /dev/null
+++ b/application/resources/src/main/res/drawable/ic_repeat_one_48dp.xml
@@ -0,0 +1,13 @@
+<!--From Google Fonts repeat_one_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="M7,7h10v1.79c0,0.45 0.54,0.67 0.85,0.35l2.79,-2.79c0.2,-0.2 0.2,-0.51 0,-0.71l-2.79,-2.79c-0.31,-0.31 -0.85,-0.09 -0.85,0.36L17,5L6,5c-0.55,0 -1,0.45 -1,1v4c0,0.55 0.45,1 1,1s1,-0.45 1,-1L7,7zM17,17L7,17v-1.79c0,-0.45 -0.54,-0.67 -0.85,-0.35l-2.79,2.79c-0.2,0.2 -0.2,0.51 0,0.71l2.79,2.79c0.31,0.31 0.85,0.09 0.85,-0.36L7,19h11c0.55,0 1,-0.45 1,-1v-4c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v3zM13,14.25L13,9.81c0,-0.45 -0.36,-0.81 -0.81,-0.81 -0.13,0 -0.25,0.03 -0.36,0.09l-1.49,0.74c-0.21,0.1 -0.34,0.32 -0.34,0.55 0,0.34 0.28,0.62 0.62,0.62h0.88v3.25c0,0.41 0.34,0.75 0.75,0.75s0.75,-0.34 0.75,-0.75z"
+      tools:fillColor="#ffffff"
+      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 71cbce089..47e8ff4e7 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)
-                options.add(PlayerOption(ID_REPEAT, R.drawable.ic_repeat, res.getString(R.string.repeat_title)))
             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)))
             options.add(PlayerOption(ID_VIDEO_STATS, R.attr.ic_video_stats, res.getString(R.string.video_information)))
         }
         val chaptersCount = service.getChapters(-1)?.size ?: 0
@@ -279,18 +279,18 @@ class PlayerOptionsDelegate(val activity: FragmentActivity, val service: Playbac
     private fun setRepeatMode() {
         when (service.repeatType) {
             PlaybackStateCompat.REPEAT_MODE_NONE -> {
-                repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat_one)
+                repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat_one_48dp)
                 service.repeatType = PlaybackStateCompat.REPEAT_MODE_ONE
             }
             PlaybackStateCompat.REPEAT_MODE_ONE -> if (service.hasPlaylist()) {
-                repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat_all)
+                repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat_all_48dp)
                 service.repeatType = PlaybackStateCompat.REPEAT_MODE_ALL
             } else {
-                repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat)
+                repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat_48dp)
                 service.repeatType = PlaybackStateCompat.REPEAT_MODE_NONE
             }
             PlaybackStateCompat.REPEAT_MODE_ALL -> {
-                repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat)
+                repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat_48dp)
                 service.repeatType = PlaybackStateCompat.REPEAT_MODE_NONE
             }
         }
@@ -342,9 +342,9 @@ class PlayerOptionsDelegate(val activity: FragmentActivity, val service: Playbac
         repeatBinding = binding
         AppScope.launch(Dispatchers.Main) {
             repeatBinding.optionIcon.setImageResource(when (service.repeatType) {
-                PlaybackStateCompat.REPEAT_MODE_ONE -> R.drawable.ic_repeat_one
-                PlaybackStateCompat.REPEAT_MODE_ALL -> R.drawable.ic_repeat_all
-                else -> R.drawable.ic_repeat
+                PlaybackStateCompat.REPEAT_MODE_ONE -> R.drawable.ic_repeat_one_48dp
+                PlaybackStateCompat.REPEAT_MODE_ALL -> R.drawable.ic_repeat_all_48dp
+                else -> R.drawable.ic_repeat_48dp
             })
         }
     }



More information about the Android mailing list