fix the home tab text colour against the dark theme

This commit is contained in:
austinried
2026-10-04 00:30:06 +00:00
parent 378d6a3b47
commit 82b62b8d9d
2 changed files with 90 additions and 73 deletions
@@ -19,10 +19,12 @@ import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.AssistChip
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@@ -127,74 +129,84 @@ fun HomeScreen(
onSync: () -> Unit = {},
modifier: Modifier = Modifier,
) {
if (feed.loading) {
LoadingState(modifier)
return
}
if (feed.isEmpty()) {
EmptyState(
text = "Nothing to show yet.\nSync with your server to fill your library.",
modifier = modifier,
actionLabel = "Sync",
onAction = onSync,
)
return
}
LazyColumn(
modifier = modifier.fillMaxSize(),
contentPadding = PaddingValues(top = topInset + 8.dp, bottom = bottomInset + 24.dp),
) {
albumRow(
HomeSection.RecentlyPlayedAlbums,
feed.recentlyPlayedAlbums,
coverArt,
onAlbumClick,
onLongClick,
onMore,
)
artistRow(
HomeSection.RecentlyPlayedArtists,
feed.recentlyPlayedArtists,
coverArt,
onArtistClick,
onLongClick,
onMore,
)
albumRow(
HomeSection.MostPlayedAlbums,
feed.mostPlayedAlbums,
coverArt,
onAlbumClick,
onLongClick,
onMore,
)
artistRow(
HomeSection.MostPlayedArtists,
feed.mostPlayedArtists,
coverArt,
onArtistClick,
onLongClick,
onMore,
)
genreBlock(HomeSection.Genres, feed.genres, onGenreClick, onMore)
decadeRow(HomeSection.Decades, feed.decades, onDecadeClick, onMore)
starredSongs(HomeSection.RecentlyStarredSongs, feed.recentlyStarredSongs, coverArt, playingSongId, onSongClick, onLongClick, onMore)
albumRow(
HomeSection.RecentlyAddedAlbums,
feed.recentlyAddedAlbums,
coverArt,
onAlbumClick,
onLongClick,
onMore,
)
albumRow(
HomeSection.Rediscover,
feed.rediscoverAlbums,
coverArt,
onAlbumClick,
onLongClick,
onMore,
)
CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onBackground) {
if (feed.loading) {
LoadingState(modifier)
return@CompositionLocalProvider
}
if (feed.isEmpty()) {
EmptyState(
text = "Nothing to show yet.\nSync with your server to fill your library.",
modifier = modifier,
actionLabel = "Sync",
onAction = onSync,
)
return@CompositionLocalProvider
}
LazyColumn(
modifier = modifier.fillMaxSize(),
contentPadding = PaddingValues(top = topInset + 8.dp, bottom = bottomInset + 24.dp),
) {
albumRow(
HomeSection.RecentlyPlayedAlbums,
feed.recentlyPlayedAlbums,
coverArt,
onAlbumClick,
onLongClick,
onMore,
)
artistRow(
HomeSection.RecentlyPlayedArtists,
feed.recentlyPlayedArtists,
coverArt,
onArtistClick,
onLongClick,
onMore,
)
albumRow(
HomeSection.MostPlayedAlbums,
feed.mostPlayedAlbums,
coverArt,
onAlbumClick,
onLongClick,
onMore,
)
artistRow(
HomeSection.MostPlayedArtists,
feed.mostPlayedArtists,
coverArt,
onArtistClick,
onLongClick,
onMore,
)
genreBlock(HomeSection.Genres, feed.genres, onGenreClick, onMore)
decadeRow(HomeSection.Decades, feed.decades, onDecadeClick, onMore)
starredSongs(
HomeSection.RecentlyStarredSongs,
feed.recentlyStarredSongs,
coverArt,
playingSongId,
onSongClick,
onLongClick,
onMore,
)
albumRow(
HomeSection.RecentlyAddedAlbums,
feed.recentlyAddedAlbums,
coverArt,
onAlbumClick,
onLongClick,
onMore,
)
albumRow(
HomeSection.Rediscover,
feed.rediscoverAlbums,
coverArt,
onAlbumClick,
onLongClick,
onMore,
)
}
}
}
@@ -1,6 +1,9 @@
package com.subtracks.ui.home
import androidx.activity.ComponentActivity
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Surface
import androidx.compose.ui.Modifier
import androidx.compose.ui.test.junit4.v2.createAndroidComposeRule
import androidx.compose.ui.test.onAllNodesWithText
import androidx.compose.ui.test.onRoot
@@ -30,11 +33,13 @@ class HomeScreenshotTest {
fun home() {
composeRule.setContent {
SubtracksTheme {
HomeScreen(
feed = feed(),
coverArt = { _, _ -> null },
playingSongId = null,
)
Surface(modifier = Modifier.fillMaxSize()) {
HomeScreen(
feed = feed(),
coverArt = { _, _ -> null },
playingSongId = null,
)
}
}
}
composeRule.waitUntil(timeoutMillis = 5_000) {