[Android] Fix the header buttons not working for the playlists

Nicolas Pomepuy git at videolan.org
Tue Jul 12 09:52:01 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Jul 12 09:26:29 2022 +0200| [1c7ea9f0bbf10732e39c83a15a8fba5fa661ad87] | committer: Duncan McNamara

Fix the header buttons not working for the playlists

Fixes #2597

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

 .../src/org/videolan/vlc/gui/HeaderMediaListActivity.kt  | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/HeaderMediaListActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/HeaderMediaListActivity.kt
index 7e5f73d97..40fe692c6 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/HeaderMediaListActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/HeaderMediaListActivity.kt
@@ -43,7 +43,9 @@ import androidx.recyclerview.widget.ItemTouchHelper
 import androidx.recyclerview.widget.LinearLayoutManager
 import androidx.recyclerview.widget.RecyclerView
 import com.google.android.material.snackbar.Snackbar
-import kotlinx.coroutines.*
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
 import org.videolan.medialibrary.interfaces.Medialibrary
 import org.videolan.medialibrary.interfaces.media.Album
 import org.videolan.medialibrary.interfaces.media.MediaWrapper
@@ -142,12 +144,12 @@ open class HeaderMediaListActivity : AudioPlayerContainerActivity(), IEventsHand
                 binding.releaseYear =  if (releaseYear > 0) releaseYear.toString() else ""
                 if (releaseYear <= 0) binding.releaseDate.visibility = View.GONE
             }
-            binding.btnShuffle.setOnClickListener {
-                MediaUtils.playTracks(this, viewModel.playlist, SecureRandom().nextInt(min(playlist.tracksCount, MEDIALIBRARY_PAGE_SIZE)), true)
-            }
-            binding.btnAddPlaylist.setOnClickListener {
-                addToPlaylist(viewModel.playlist.tracks.toList())
-            }
+        }
+        binding.btnShuffle.setOnClickListener {
+            MediaUtils.playTracks(this, viewModel.playlist, SecureRandom().nextInt(min(playlist.tracksCount, MEDIALIBRARY_PAGE_SIZE)), true)
+        }
+        binding.btnAddPlaylist.setOnClickListener {
+            addToPlaylist(viewModel.playlist.tracks.toList())
         }
 
         binding.songs.layoutManager = LinearLayoutManager(this)



More information about the Android mailing list