fix(android): name Library tab indices (detekt MagicNumber)
detekt flagged the `3` and `4` branch labels in the `when (selectedTab)` block. Promoted all five indices to TAB_ARTISTS … TAB_HIDDEN constants — same shape detekt would have suggested. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -91,19 +91,19 @@ fun LibraryScreen(
|
||||
) { inner ->
|
||||
Box(modifier = Modifier.fillMaxSize().padding(inner)) {
|
||||
when (selectedTab) {
|
||||
0 -> ArtistsTab(viewModel = viewModel, navController = navController)
|
||||
1 -> AlbumsTab(viewModel = viewModel, navController = navController)
|
||||
2 -> ComingSoonTab(
|
||||
TAB_ARTISTS -> ArtistsTab(viewModel = viewModel, navController = navController)
|
||||
TAB_ALBUMS -> AlbumsTab(viewModel = viewModel, navController = navController)
|
||||
TAB_HISTORY -> ComingSoonTab(
|
||||
title = "History",
|
||||
body = "Recent plays will appear here once /api/me/history " +
|
||||
"wiring lands in Phase 9.",
|
||||
)
|
||||
3 -> ComingSoonTab(
|
||||
TAB_LIKED -> ComingSoonTab(
|
||||
title = "Liked",
|
||||
body = "Liked artists, albums, and tracks will appear here " +
|
||||
"once the like-write path lands in Phase 8.",
|
||||
)
|
||||
4 -> ComingSoonTab(
|
||||
TAB_HIDDEN -> ComingSoonTab(
|
||||
title = "Hidden",
|
||||
body = "Tracks you've flagged as bad rips, wrong tags, or " +
|
||||
"duplicates will appear here in Phase 10.",
|
||||
@@ -113,6 +113,12 @@ fun LibraryScreen(
|
||||
}
|
||||
}
|
||||
|
||||
private const val TAB_ARTISTS = 0
|
||||
private const val TAB_ALBUMS = 1
|
||||
private const val TAB_HISTORY = 2
|
||||
private const val TAB_LIKED = 3
|
||||
private const val TAB_HIDDEN = 4
|
||||
|
||||
private val LIBRARY_TABS = listOf("Artists", "Albums", "History", "Liked", "Hidden")
|
||||
|
||||
@Composable
|
||||
|
||||
Reference in New Issue
Block a user