feat: button to play recent videos from a channel

This commit is contained in:
Bnyro 2024-07-11 18:42:15 +02:00
parent 5b19670fb6
commit 3e4f430369
2 changed files with 16 additions and 0 deletions

View File

@ -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

View File

@ -131,6 +131,15 @@
app:icon="@drawable/ic_add"
tools:targetApi="m" />
<com.google.android.material.button.MaterialButton
android:id="@+id/play_all"
style="@style/PlayerActionsButton"
android:text="@string/play_latest_videos"
android:textSize="12sp"
android:tooltipText="@string/play_latest_videos"
app:icon="@drawable/ic_playlist"
tools:targetApi="m" />
</LinearLayout>
</HorizontalScrollView>