@@ -15,6 +15,7 @@ import androidx.compose.foundation.lazy.items
1515import androidx.compose.material3.HorizontalDivider
1616import androidx.compose.material3.MaterialTheme
1717import androidx.compose.material3.Text
18+ import androidx.compose.material3.darkColorScheme
1819import androidx.compose.runtime.Composable
1920import androidx.compose.ui.Alignment
2021import androidx.compose.ui.Modifier
@@ -112,7 +113,9 @@ fun DoseListItem(
112113 Box (
113114 modifier = Modifier
114115 .background(
115- color = dose.doses.first().color.hexToColor().copy(alpha = 0.5f )
116+ color = dose.doses.first().color.hexToColor().copy(
117+ alpha = if (isInDarkMode()) 0.3f else 0.5f
118+ )
116119 )
117120 .fillMaxWidth()
118121 .clickable { onClick(dose) }
@@ -125,11 +128,13 @@ fun DoseListItem(
125128 Text (
126129 fontSize = 14 .sp,
127130 fontStyle = FontStyle .Italic ,
131+ color = MaterialTheme .colorScheme.onSurface,
128132 text = format.format(Date (dose.getTime()))
129133 )
130134 Text (
131135 fontSize = 18 .sp,
132136 fontWeight = FontWeight .SemiBold ,
137+ color = MaterialTheme .colorScheme.onSurface,
133138 text = dose.displayedTotal()
134139 )
135140
@@ -156,10 +161,12 @@ fun DoseListPreview() {
156161 testDoseGroup(testDateTime(12 , 1 , 15 , date = 2 ), 14 ),
157162 testDoseGroup(testDateTime(12 , 1 , 14 , date = 3 ), 14 ),
158163 )
159- DoseList (
160- items,
161- currentDoseGroup = current
162- )
164+ MaterialTheme (colorScheme = darkColorScheme()) {
165+ DoseList (
166+ items,
167+ currentDoseGroup = current
168+ )
169+ }
163170}
164171
165172@Preview
0 commit comments