[Android] Tracks: add FORCE_PLAY_ALL_AUDIO check

Duncan McNamara git at videolan.org
Thu Jun 22 06:18:16 UTC 2023


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Wed Jun 21 14:08:03 2023 +0200| [6e35ac4a6bdbf385a9e195d44ce70f730e349820] | committer: Nicolas Pomepuy

Tracks: add FORCE_PLAY_ALL_AUDIO check

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

 .../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt     | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt
index d3f31d2c5b..deb2d77ad1 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt
@@ -24,6 +24,7 @@ import android.content.Intent
 import android.content.SharedPreferences
 import android.content.res.Configuration
 import android.os.Bundle
+import android.util.Log
 import android.util.SparseArray
 import android.view.*
 import android.widget.TextView
@@ -395,6 +396,7 @@ class AudioBrowserFragment : BaseAudioBrowser<AudioBrowserViewModel>() {
         else super.onCtxAction(position, option)
     }
 
+    private val TAG = this::class.java.name
     override fun onClick(v: View, position: Int, item: MediaLibraryItem) {
         if (actionMode != null) {
             super.onClick(v, position, item)
@@ -406,7 +408,13 @@ class AudioBrowserFragment : BaseAudioBrowser<AudioBrowserViewModel>() {
                 UiTools.snackerMissing(requireActivity())
                 return
             }
-            MediaUtils.openMedia(activity, item as MediaWrapper)
+            Log.d(TAG, "onClick: skbench: ")
+            if (Settings.getInstance(requireContext()).getBoolean(FORCE_PLAY_ALL_AUDIO, false)) {
+                MediaUtils.playAll(activity,
+                    viewModel.providers[currentTab] as MedialibraryProvider<MediaWrapper>, position, false)
+            } else {
+                MediaUtils.openMedia(activity, item as MediaWrapper)
+            }
             return
         }
         val i: Intent



More information about the Android mailing list