Merge pull request #2830 from Bnyro/master

[Audio mode] Show video options when clicking thumbnail
This commit is contained in:
Bnyro 2023-01-22 19:51:07 +01:00 committed by GitHub
commit 7884edc88f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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.sheets.PlaybackOptionsSheet
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.ImageHelper
import com.github.libretube.util.NavigationHelper
@ -128,6 +129,14 @@ class AudioPlayerFragment : BaseFragment() {
).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
PlayingQueue.addOnTrackChangedListener(onTrackChangeListener)

View File

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