Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Audio mode] Show video options when clicking thumbnail #2830

Merged
merged 1 commit into from
Jan 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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?) {
Expand Down