refactor: remove redundant color attributes and improve color contrast handling

This commit is contained in:
Antoine Jaury
2026-10-19 15:53:25 +02:00
parent 0add1176db
commit 34cb8d24a4
10 changed files with 150 additions and 16 deletions
@@ -241,7 +241,6 @@ private fun PlayerTopBar(
Text(
text = translation,
style = MaterialTheme.typography.titleSmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
@@ -10,6 +10,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.semantics.ProgressBarRangeInfo
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.semantics.contentDescription
@@ -69,13 +70,12 @@ fun LabeledSlider(
Text(
text = title,
style = MaterialTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onSurface.copy(alpha = contentAlpha),
modifier = Modifier.weight(1f),
modifier = Modifier.weight(1f).alpha(contentAlpha),
)
Text(
modifier = Modifier.alpha(contentAlpha),
text = valueLabel,
style = MaterialTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.primary.copy(alpha = contentAlpha),
style = MaterialTheme.typography.labelLarge,
maxLines = 1,
softWrap = false,
)
@@ -51,7 +51,6 @@ fun PreferenceToggle(
Text(
text = subtitle,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
@@ -60,7 +60,6 @@ fun RecordView(
Text(
text = translation,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
}