[Audio mode] Show video options when clicking thumbnail

This commit is contained in:
Bnyro 2023-01-22 19:50:50 +01:00
parent a04fb31947
commit cbbfa64f76
2 changed files with 10 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import com.github.libretube.ui.base.BaseFragment
import com.github.libretube.ui.dialogs.ShareDialog import com.github.libretube.ui.dialogs.ShareDialog
import com.github.libretube.ui.sheets.PlaybackOptionsSheet import com.github.libretube.ui.sheets.PlaybackOptionsSheet
import com.github.libretube.ui.sheets.PlayingQueueSheet import com.github.libretube.ui.sheets.PlayingQueueSheet
import com.github.libretube.ui.sheets.VideoOptionsBottomSheet
import com.github.libretube.util.BackgroundHelper import com.github.libretube.util.BackgroundHelper
import com.github.libretube.util.ImageHelper import com.github.libretube.util.ImageHelper
import com.github.libretube.util.NavigationHelper import com.github.libretube.util.NavigationHelper
@ -128,6 +129,14 @@ class AudioPlayerFragment : BaseFragment() {
).show(childFragmentManager, null) ).show(childFragmentManager, null)
} }
binding.thumbnail.setOnClickListener {
val current = PlayingQueue.getCurrent()
current?.let {
VideoOptionsBottomSheet(it.url!!.toID(), it.title!!)
.show(childFragmentManager)
}
}
// Listen for track changes due to autoplay or the notification // Listen for track changes due to autoplay or the notification
PlayingQueue.addOnTrackChangedListener(onTrackChangeListener) PlayingQueue.addOnTrackChangedListener(onTrackChangeListener)

View File

@ -22,7 +22,7 @@ import kotlinx.coroutines.launch
*/ */
class VideoOptionsBottomSheet( class VideoOptionsBottomSheet(
private val videoId: String, private val videoId: String,
private val videoName: String videoName: String
) : BaseBottomSheet() { ) : BaseBottomSheet() {
private val shareData = ShareData(currentVideo = videoName) private val shareData = ShareData(currentVideo = videoName)
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {