bug fixes

This commit is contained in:
Bnyro 2022-10-28 22:18:18 +02:00
parent 7837ce1c60
commit 67982186c6
3 changed files with 10 additions and 5 deletions

View File

@ -33,13 +33,17 @@ class PlayingQueueSheet : BottomSheetDialogFragment() {
binding.shuffle.setOnClickListener { binding.shuffle.setOnClickListener {
val streams = PlayingQueue.getStreams() val streams = PlayingQueue.getStreams()
streams.subList(PlayingQueue.currentIndex(), PlayingQueue.size()).shuffle() val size = PlayingQueue.size()
adapter.notifyItemRangeChanged(0, PlayingQueue.size()) streams.subList(PlayingQueue.currentIndex(), size).shuffle()
adapter.notifyItemRangeChanged(0, size)
} }
binding.clear.setOnClickListener { binding.clear.setOnClickListener {
val streams = PlayingQueue.getStreams() val streams = PlayingQueue.getStreams()
streams.subList(PlayingQueue.currentIndex(), PlayingQueue.size()).clear() val currentIndex = PlayingQueue.currentIndex()
val size = PlayingQueue.size()
streams.subList(currentIndex, size).clear()
adapter.notifyItemRangeRemoved(currentIndex + 1, size)
} }
binding.bottomControls.setOnClickListener { binding.bottomControls.setOnClickListener {

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp" android:width="24dp"
android:height="24dp" android:height="24dp"
android:tint="#000000" android:tint="?attr/colorControlNormal"
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24"> android:viewportHeight="24">
<path <path

View File

@ -26,7 +26,8 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/options_recycler" android:id="@+id/options_recycler"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="0dp"
android:layout_weight="1" />
<LinearLayout <LinearLayout
android:id="@+id/bottom_controls" android:id="@+id/bottom_controls"