Merge pull request #4356 from Bnyro/master

feat: control to clear entire playing queue
This commit is contained in:
Bnyro 2023-08-03 15:01:24 +02:00 committed by GitHub
commit a487e12a79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 9 deletions

View File

@ -68,9 +68,15 @@ class PlayingQueueSheet : ExpandedBottomSheet() {
PlayingQueue.repeatQueue = !PlayingQueue.repeatQueue
it.alpha = if (PlayingQueue.repeatQueue) 1f else 0.5f
}
binding.repeat.alpha = if (PlayingQueue.repeatQueue) 1f else 0.5f
binding.clearQueue.setOnClickListener {
val currentIndex = PlayingQueue.currentIndex()
PlayingQueue.setStreams(PlayingQueue.getStreams()
.filterIndexed { index, _ -> index == currentIndex })
adapter.notifyDataSetChanged()
}
binding.bottomControls.setOnClickListener {
dialog?.dismiss()
}

View File

@ -55,14 +55,6 @@
android:padding="5dp"
android:src="@drawable/ic_reverse" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginHorizontal="10dp"
android:layout_weight="1"
android:src="@drawable/ic_arrow_down" />
<ImageView
android:id="@+id/repeat"
android:layout_width="wrap_content"
@ -81,6 +73,24 @@
android:padding="5dp"
android:src="@drawable/ic_playlist_add" />
<ImageView
android:id="@+id/clear_queue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="5dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="5dp"
android:src="@drawable/ic_close" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginHorizontal="10dp"
android:paddingVertical="5dp"
android:layout_weight="1"
android:src="@drawable/ic_arrow_down" />
</LinearLayout>
</LinearLayout>