From 3e4f43036979d1b31c744775ed40b1666889f86b Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 11 Jul 2024 18:42:15 +0200 Subject: [PATCH] feat: button to play recent videos from a channel --- .../com/github/libretube/ui/fragments/ChannelFragment.kt | 7 +++++++ app/src/main/res/layout/fragment_channel.xml | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt index 206f1eeb9..7c7c6d217 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt @@ -181,6 +181,13 @@ class ChannelFragment : DynamicLayoutManagerFragment() { }.show(childFragmentManager) } + binding.playAll.setOnClickListener { + val firstVideoId = + response.relatedStreams.firstOrNull()?.url?.toID() ?: return@setOnClickListener + + NavigationHelper.navigateVideo(requireContext(), firstVideoId, channelId = channelId) + } + nextPages[0] = response.nextpage isLoading = false binding.channelRefresh.isRefreshing = false diff --git a/app/src/main/res/layout/fragment_channel.xml b/app/src/main/res/layout/fragment_channel.xml index f5b11a27b..28d9e8a99 100644 --- a/app/src/main/res/layout/fragment_channel.xml +++ b/app/src/main/res/layout/fragment_channel.xml @@ -131,6 +131,15 @@ app:icon="@drawable/ic_add" tools:targetApi="m" /> + +