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,9 +129,10 @@ fun HomeScreen(
onSync: () -> Unit = {},
modifier: Modifier = Modifier,
) {
CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onBackground) {
if (feed.loading) {
LoadingState(modifier)
return
return@CompositionLocalProvider
}
if (feed.isEmpty()) {
EmptyState(
@@ -138,7 +141,7 @@ fun HomeScreen(
actionLabel = "Sync",
onAction = onSync,
)
return
return@CompositionLocalProvider
}
LazyColumn(
modifier = modifier.fillMaxSize(),
@@ -178,7 +181,15 @@ fun HomeScreen(
)
genreBlock(HomeSection.Genres, feed.genres, onGenreClick, onMore)
decadeRow(HomeSection.Decades, feed.decades, onDecadeClick, onMore)
starredSongs(HomeSection.RecentlyStarredSongs, feed.recentlyStarredSongs, coverArt, playingSongId, onSongClick, onLongClick, onMore)
starredSongs(
HomeSection.RecentlyStarredSongs,
feed.recentlyStarredSongs,
coverArt,
playingSongId,
onSongClick,
onLongClick,
onMore,
)
albumRow(
HomeSection.RecentlyAddedAlbums,
feed.recentlyAddedAlbums,
@@ -197,6 +208,7 @@ fun HomeScreen(
)
}
}
}
private fun HomeFeed.isEmpty(): Boolean =
recentlyPlayedAlbums.isEmpty() &&
@@ -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,6 +33,7 @@ class HomeScreenshotTest {
fun home() {
composeRule.setContent {
SubtracksTheme {
Surface(modifier = Modifier.fillMaxSize()) {
HomeScreen(
feed = feed(),
coverArt = { _, _ -> null },
@@ -37,6 +41,7 @@ class HomeScreenshotTest {
)
}
}
}
composeRule.waitUntil(timeoutMillis = 5_000) {
composeRule.onAllNodesWithText("Recently played").fetchSemanticsNodes().isNotEmpty()
}