fix(android) detekt: extract AlbumDetailStateContent helper

Crossfade wrapper pushed AlbumDetailScreen over the 60-line cap (62).
Extracted the inner state-machine + Crossfade + success-body
composition into AlbumDetailStateContent so the main composable
keeps only Scaffold/TopAppBar/PullToRefreshScaffold wiring.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-27 14:40:36 -04:00
parent 89203fc4a1
commit 69179e0af3
@@ -94,6 +94,29 @@ fun AlbumDetailScreen(
PullToRefreshScaffold(
onRefresh = { viewModel.refresh().join() },
modifier = Modifier.fillMaxSize().padding(inner),
) {
AlbumDetailStateContent(
state = state,
viewModel = viewModel,
playerViewModel = playerViewModel,
navController = navController,
)
}
}
}
private fun titleFor(state: AlbumDetailUiState): String = when (state) {
is AlbumDetailUiState.Success -> state.detail.album.title
is AlbumDetailUiState.Loading -> state.seed?.title ?: "Album"
is AlbumDetailUiState.Error -> "Album"
}
@Composable
private fun AlbumDetailStateContent(
state: AlbumDetailUiState,
viewModel: AlbumDetailViewModel,
playerViewModel: com.fabledsword.minstrel.player.ui.PlayerViewModel,
navController: NavHostController,
) {
Crossfade(targetState = state, label = "album-detail") { s ->
when (s) {
@@ -129,14 +152,6 @@ fun AlbumDetailScreen(
}
}
}
}
}
private fun titleFor(state: AlbumDetailUiState): String = when (state) {
is AlbumDetailUiState.Success -> state.detail.album.title
is AlbumDetailUiState.Loading -> state.seed?.title ?: "Album"
is AlbumDetailUiState.Error -> "Album"
}
@Composable
private fun AlbumBody(