[Android] New icon for the playback speed mode "All"

Nicolas Pomepuy git at videolan.org
Fri Feb 14 13:01:41 UTC 2025


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Feb 14 12:32:59 2025 +0100| [30c54eac80afa3bc07ae3c12891374e6f5ebd0c3] | committer: Duncan McNamara

New icon for the playback speed mode "All"

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

 .../resources/assets/images/svg/ic_speed_all.svg   | 62 ++++++++++++++++++++++
 .../src/main/res/drawable/ic_speed_all.xml         | 10 ++++
 .../src/org/videolan/vlc/gui/audio/AudioPlayer.kt  |  6 +++
 .../vlc/gui/video/VideoPlayerOverlayDelegate.kt    |  6 +++
 4 files changed, 84 insertions(+)

diff --git a/application/resources/assets/images/svg/ic_speed_all.svg b/application/resources/assets/images/svg/ic_speed_all.svg
new file mode 100644
index 0000000000..bed93b633d
--- /dev/null
+++ b/application/resources/assets/images/svg/ic_speed_all.svg
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   width="48"
+   height="48"
+   viewBox="0 0 48 48"
+   version="1.1"
+   id="svg1"
+   inkscape:version="1.4 (1:1.4+202410161351+e7c3feb100)"
+   sodipodi:docname="ic_playbackspeedall_1.svg"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <sodipodi:namedview
+     id="namedview1"
+     pagecolor="#ffffff"
+     bordercolor="#000000"
+     borderopacity="0.25"
+     inkscape:showpageshadow="2"
+     inkscape:pageopacity="0.0"
+     inkscape:pagecheckerboard="0"
+     inkscape:deskcolor="#d1d1d1"
+     inkscape:document-units="px"
+     showgrid="true"
+     inkscape:zoom="16.895833"
+     inkscape:cx="23.970407"
+     inkscape:cy="24"
+     inkscape:window-width="1920"
+     inkscape:window-height="1043"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="layer1">
+    <inkscape:grid
+       id="grid1"
+       units="px"
+       originx="0"
+       originy="0"
+       spacingx="1"
+       spacingy="1"
+       empcolor="#0099e5"
+       empopacity="0.30196078"
+       color="#0099e5"
+       opacity="0.14901961"
+       empspacing="4"
+       enabled="true"
+       visible="true" />
+  </sodipodi:namedview>
+  <defs
+     id="defs1" />
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       id="path25"
+       style="fill:#1a1a1a;stroke-width:2"
+       d="M 27.716797 7.9628906 A 20 20 0 0 0 10.654297 38 A 4 4 0 0 0 14.095703 40 L 41.794922 40 A 4 4 0 0 0 45.275391 38 A 20 20 0 0 0 46.375 20.220703 A 2 2 0 0 0 42.875 20 A 2 2 0 0 0 42.734375 22 A 15.1 15.1 0 0 1 43.775391 25.619141 A 16 16 0 0 1 42.394531 35.080078 A 2 2 0 0 1 40.615234 36.140625 L 15.314453 36.140625 A 2 2 0 0 1 13.535156 35.060547 A 16 16 0 0 1 29.955078 12.119141 A 15.38 15.38 0 0 1 34.175781 13.240234 A 2 2 0 0 0 36.175781 13.099609 A 2 2 0 0 0 35.835938 9.5800781 A 20 20 0 0 0 27.716797 7.9628906 z M 6.4375 12.029297 A 2 2 0 0 0 4.4003906 12.921875 C 1.531604 17.409615 0.00516974 22.624894 0 27.951172 A 2.0002 2.0002 0 0 0 0 27.958984 C 0.02477046 35.225754 2.8809396 42.200603 7.9589844 47.398438 A 2.0002 2.0002 0 0 0 9.3886719 48 L 33.955078 48 A 2 2 0 0 0 35.955078 46 A 2 2 0 0 0 33.955078 44 L 10.333984 44 C 6.3184302 39.613522 4.0222861 33.920301 4 27.955078 L 4 27.951172 C 4.00517 23.388126 5.3137722 18.922808 7.7714844 15.078125 A 2 2 0 0 0 7.1640
 625 12.314453 A 2 2 0 0 0 6.4375 12.029297 z M 42.115234 13.859375 L 25.134766 25.179688 A 4.0023349 4.0023349 0 0 0 30.794922 30.839844 L 42.115234 13.859375 z " />
+  </g>
+</svg>
diff --git a/application/resources/src/main/res/drawable/ic_speed_all.xml b/application/resources/src/main/res/drawable/ic_speed_all.xml
new file mode 100644
index 0000000000..b9b2814381
--- /dev/null
+++ b/application/resources/src/main/res/drawable/ic_speed_all.xml
@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="48"
+    android:viewportHeight="48">
+  <path
+      android:pathData="M27.717,7.963A20,20 0,0 0,10.654 38A4,4 0,0 0,14.096 40L41.795,40A4,4 0,0 0,45.275 38A20,20 0,0 0,46.375 20.221A2,2 0,0 0,42.875 20A2,2 0,0 0,42.734 22A15.1,15.1 0,0 1,43.775 25.619A16,16 0,0 1,42.395 35.08A2,2 0,0 1,40.615 36.141L15.314,36.141A2,2 0,0 1,13.535 35.061A16,16 0,0 1,29.955 12.119A15.38,15.38 0,0 1,34.176 13.24A2,2 0,0 0,36.176 13.1A2,2 0,0 0,35.836 9.58A20,20 0,0 0,27.717 7.963zM6.438,12.029A2,2 0,0 0,4.4 12.922C1.532,17.41 0.005,22.625 0,27.951A2,2 0,0 0,0 27.959C0.025,35.226 2.881,42.201 7.959,47.398A2,2 0,0 0,9.389 48L33.955,48A2,2 0,0 0,35.955 46A2,2 0,0 0,33.955 44L10.334,44C6.318,39.614 4.022,33.92 4,27.955L4,27.951C4.005,23.388 5.314,18.923 7.771,15.078A2,2 0,0 0,7.164 12.314A2,2 0,0 0,6.438 12.029zM42.115,13.859L25.135,25.18A4.002,4.002 0,0 0,30.795 30.84L42.115,13.859z"
+      android:strokeWidth="2"
+      android:fillColor="#fff"/>
+</vector>
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
index 7cf8e90cb6..45b493efcd 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
@@ -42,6 +42,7 @@ import android.widget.SeekBar.OnSeekBarChangeListener
 import androidx.annotation.RequiresPermission
 import androidx.appcompat.app.AppCompatActivity
 import androidx.constraintlayout.widget.ConstraintLayout
+import androidx.core.content.ContextCompat
 import androidx.core.content.getSystemService
 import androidx.fragment.app.Fragment
 import androidx.lifecycle.Lifecycle
@@ -318,6 +319,11 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, IAudioPlay
                 if (it != 1.0F) binding.playbackSpeedQuickAction.setVisible()
                 binding.playbackSpeedQuickAction.text = it.formatRateString()
             }
+            if (settings.getBoolean(KEY_PLAYBACK_SPEED_AUDIO_GLOBAL, false)) {
+                binding.playbackSpeedQuickAction.chipIcon = ContextCompat.getDrawable(requireActivity(), R.drawable.ic_speed_all)
+            } else {
+                binding.playbackSpeedQuickAction.chipIcon = ContextCompat.getDrawable(requireActivity(), R.drawable.ic_speed)
+            }
             PlaybackService.playerSleepTime.value?.let {
                 binding.sleepQuickAction.setVisible()
                 binding.sleepQuickAction.text = DateFormat.getTimeFormat(requireContext()).format(it.time)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt
index 450a82efe6..975230a61c 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt
@@ -942,6 +942,12 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
             hudRightBinding.playerOverlayNavmenu.visibility = if (player.menuIdx >= 0) View.VISIBLE else View.GONE
             hudRightBinding.sleepQuickAction.visibility = if (show && PlaybackService.playerSleepTime.value != null) View.VISIBLE else View.GONE
             hudRightBinding.playbackSpeedQuickAction.visibility = if (show && player.service?.rate != 1.0F) View.VISIBLE else View.GONE
+            if (Settings.getInstance(player).getBoolean(KEY_PLAYBACK_SPEED_VIDEO_GLOBAL, false)) {
+                hudRightBinding.playbackSpeedQuickAction.chipIcon = ContextCompat.getDrawable(player, R.drawable.ic_speed_all)
+            } else {
+                hudRightBinding.playbackSpeedQuickAction.chipIcon = ContextCompat.getDrawable(player, R.drawable.ic_speed)
+            }
+
             hudRightBinding.spuDelayQuickAction.visibility = if (show && player.service?.spuDelay != 0L) View.VISIBLE else View.GONE
             hudRightBinding.audioDelayQuickAction.visibility = if (show && player.service?.audioDelay != 0L) View.VISIBLE else View.GONE
             hudRightBinding.clock.visibility = if (Settings.showTvUi) View.VISIBLE else View.GONE



More information about the Android mailing list