Automatically scroll to the currently playing video in the queue

This commit is contained in:
Bnyro 2023-04-25 13:58:01 +02:00
parent 94d37c5224
commit 1c6f561ff9

View File

@ -33,6 +33,10 @@ class PlayingQueueSheet : ExpandedBottomSheet() {
val adapter = PlayingQueueAdapter()
binding.optionsRecycler.adapter = adapter
// scroll to the currently playing video in the queue
val currentPlayingIndex = PlayingQueue.currentIndex()
if (currentPlayingIndex != -1) binding.optionsRecycler.scrollToPosition(currentPlayingIndex)
binding.shuffle.setOnClickListener {
val streams = PlayingQueue.getStreams().toMutableList()
val currentIndex = PlayingQueue.currentIndex()