From 924846c6737f8977b264b0e3310b00c1e50a0a70 Mon Sep 17 00:00:00 2001 From: ArnoKeesmand Date: Mon, 6 Nov 2023 16:57:23 +0100 Subject: [PATCH] feat: navigate from episode to season clicking episode_name navigates to the season for that episode seasonName added to episode classes so the opened season view can have it's name --- .../fragments/EpisodeBottomSheetFragment.kt | 15 +++++++++++++++ .../src/main/res/navigation/app_navigation.xml | 3 +++ .../dev/jdtech/jellyfin/models/FindroidEpisode.kt | 3 +++ 3 files changed, 21 insertions(+) diff --git a/app/phone/src/main/java/dev/jdtech/jellyfin/fragments/EpisodeBottomSheetFragment.kt b/app/phone/src/main/java/dev/jdtech/jellyfin/fragments/EpisodeBottomSheetFragment.kt index 17c61caf71..25fd9bb85a 100644 --- a/app/phone/src/main/java/dev/jdtech/jellyfin/fragments/EpisodeBottomSheetFragment.kt +++ b/app/phone/src/main/java/dev/jdtech/jellyfin/fragments/EpisodeBottomSheetFragment.kt @@ -148,6 +148,10 @@ class EpisodeBottomSheetFragment : BottomSheetDialogFragment() { navigateToSeries(viewModel.item.seriesId, viewModel.item.seriesName) } + binding.episodeName.setOnClickListener { + navigateToSeason(viewModel.item.seriesId, viewModel.item.seasonId, viewModel.item.seriesName, viewModel.item.seasonName) + } + binding.itemActions.checkButton.setOnClickListener { viewModel.togglePlayed() } @@ -421,6 +425,17 @@ class EpisodeBottomSheetFragment : BottomSheetDialogFragment() { ) } + private fun navigateToSeason(seriesId: UUID, seasonId: UUID, seriesName: String, seasonName: String?) { + findNavController().navigate( + EpisodeBottomSheetFragmentDirections.actionEpisodeBottomSheetFragmentToSeasonFragment( + seriesId, + seasonId, + seriesName, + seasonName, + ), + ) + } + private fun formatDateTime(datetime: DateTime?): String { if (datetime == null) return "" val instant = datetime.toInstant(ZoneOffset.UTC) diff --git a/app/phone/src/main/res/navigation/app_navigation.xml b/app/phone/src/main/res/navigation/app_navigation.xml index 6051dec7f3..177b8e8bd2 100644 --- a/app/phone/src/main/res/navigation/app_navigation.xml +++ b/app/phone/src/main/res/navigation/app_navigation.xml @@ -223,6 +223,9 @@ +