Merge pull request #6218 from Bnyro/master

feat: button to play recent videos from a channel
This commit is contained in:
Bnyro 2024-07-11 18:42:55 +02:00 committed by GitHub
commit 4f22fb0089
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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>