feat: navigate back to Series screen when exiting playback

Pop the EpisodeRoute from the navigation stack when playback starts,
so finishing PlayerActivity returns to the SeriesScreen instead of
the EpisodeScreen.
This commit is contained in:
2026-03-03 21:18:57 +01:00
parent 5ca127434d
commit 12fdf977a4
2 changed files with 5 additions and 0 deletions

View File

@@ -74,6 +74,7 @@ internal fun EpisodeDetails(
episode: Episode,
downloadState: DownloadState,
onDownloadClick: () -> Unit,
onPlaybackStarted: () -> Unit,
modifier: Modifier = Modifier
) {
val scheme = MaterialTheme.colorScheme
@@ -84,6 +85,7 @@ internal fun EpisodeDetails(
val intent = Intent(context, PlayerActivity::class.java)
intent.putExtra("MEDIA_ID", episode.id.toString())
context.startActivity(intent)
onPlaybackStarted()
}
}

View File

@@ -69,6 +69,7 @@ fun EpisodeScreen(
episode = episode.value!!,
downloadState = downloadState.value,
onBack = viewModel::onBack,
onPlaybackStarted = viewModel::onBack,
onDownloadClick = onDownloadClick,
modifier = modifier
)
@@ -79,6 +80,7 @@ private fun EpisodeScreenInternal(
episode: Episode,
downloadState: DownloadState,
onBack: () -> Unit,
onPlaybackStarted: () -> Unit,
onDownloadClick: () -> Unit,
modifier: Modifier = Modifier,
) {
@@ -108,6 +110,7 @@ private fun EpisodeScreenInternal(
episode = episode,
downloadState = downloadState,
onDownloadClick = onDownloadClick,
onPlaybackStarted = onPlaybackStarted,
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp)