[Android] Add preferences for Android Auto seek buttons

Robert Stone git at videolan.org
Thu Nov 4 08:47:08 UTC 2021


vlc-android | branch: master | Robert Stone <rhstone at gmail.com> | Fri Oct 15 23:27:35 2021 -0700| [216a87472092b792e0390c37f81e1a9c2057b6a8] | committer: Nicolas Pomepuy

Add preferences for Android Auto seek buttons

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

 application/resources/src/main/res/values/strings.xml           | 4 +++-
 application/vlc-android/res/xml/preferences_audio.xml           | 9 +++++++++
 application/vlc-android/src/org/videolan/vlc/PlaybackService.kt | 2 +-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/application/resources/src/main/res/values/strings.xml b/application/resources/src/main/res/values/strings.xml
index f20c86f0f..e1179f700 100644
--- a/application/resources/src/main/res/values/strings.xml
+++ b/application/resources/src/main/res/values/strings.xml
@@ -325,7 +325,9 @@
     <string name="enable_volume_gesture_title">Volume gesture</string>
     <string name="enable_volume_gesture_summary">Control volume by gesture during video playback</string>
     <string name="enable_seek_buttons">Seek buttons</string>
-    <string name="enable_seek_buttons_summary">Show rewind and forward buttons on the video interface</string>
+    <string name="enable_seek_buttons_summary">Show rewind and fast forward buttons on the video interface</string>
+    <string name="enable_android_auto_seek_buttons">Android Auto seek buttons</string>
+    <string name="enable_android_auto_seek_buttons_summary">Show rewind and fast forward on the Android Auto interface. Try holding steering wheel previous and next buttons before enabling.</string>
     <string name="enable_double_tap_seek_title">Double tap to seek</string>
     <string name="enable_double_tap_seek_summary">Double tap on screen edges to seek by 10 seconds</string>
     <string name="popup_keepscreen_title">Keep screen ON in Pop-Up mode</string>
diff --git a/application/vlc-android/res/xml/preferences_audio.xml b/application/vlc-android/res/xml/preferences_audio.xml
index e91986ed7..e366fe719 100644
--- a/application/vlc-android/res/xml/preferences_audio.xml
+++ b/application/vlc-android/res/xml/preferences_audio.xml
@@ -55,6 +55,15 @@
                 android:title="@string/enable_play_on_headset_insertion"/>
     </PreferenceCategory>
 
+    <PreferenceCategory android:title="@string/controls_prefs_category">
+        <CheckBoxPreference
+            app:singleLineTitle="false"
+            android:defaultValue="false"
+            android:key="enable_android_auto_seek_buttons"
+            android:summary="@string/enable_android_auto_seek_buttons_summary"
+            android:title="@string/enable_android_auto_seek_buttons"/>
+    </PreferenceCategory>
+
     <PreferenceCategory android:title="@string/advanced_prefs_category">
         <CheckBoxPreference
                 app:singleLineTitle="false"
diff --git a/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt b/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
index 8871dcc1b..0e2b22bf6 100644
--- a/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
+++ b/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
@@ -1017,7 +1017,7 @@ class PlaybackService : MediaBrowserServiceCompat(), LifecycleOwner {
         }
         if (isSeekable) {
             actions = actions or PlaybackStateCompat.ACTION_FAST_FORWARD or PlaybackStateCompat.ACTION_REWIND or PlaybackStateCompat.ACTION_SEEK_TO
-            addCustomSeekActions(pscb)
+            if (settings.getBoolean("enable_android_auto_seek_buttons", false)) addCustomSeekActions(pscb)
         }
         pscb.setActions(actions)
         mediaSession.setRepeatMode(repeatType)



More information about the Android mailing list