Update button colors to support dynamic themes
This commit is contained in:
@@ -783,9 +783,13 @@ fun ModuleItem(
|
|||||||
viewModel.markNeedRefresh()
|
viewModel.markNeedRefresh()
|
||||||
},
|
},
|
||||||
contentPadding = ButtonDefaults.TextButtonContentPadding,
|
contentPadding = ButtonDefaults.TextButtonContentPadding,
|
||||||
colors = ButtonDefaults.filledTonalButtonColors(
|
colors = if (!ThemeConfig.useDynamicColor) {
|
||||||
|
ButtonDefaults.filledTonalButtonColors(
|
||||||
containerColor = ThemeConfig.currentTheme.ButtonContrast
|
containerColor = ThemeConfig.currentTheme.ButtonContrast
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
ButtonDefaults.filledTonalButtonColors()
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
modifier = Modifier.size(20.dp),
|
modifier = Modifier.size(20.dp),
|
||||||
@@ -812,9 +816,13 @@ fun ModuleItem(
|
|||||||
onClick = { onClick(module) },
|
onClick = { onClick(module) },
|
||||||
interactionSource = interactionSource,
|
interactionSource = interactionSource,
|
||||||
contentPadding = ButtonDefaults.TextButtonContentPadding,
|
contentPadding = ButtonDefaults.TextButtonContentPadding,
|
||||||
colors = ButtonDefaults.filledTonalButtonColors(
|
colors = if (!ThemeConfig.useDynamicColor) {
|
||||||
|
ButtonDefaults.filledTonalButtonColors(
|
||||||
containerColor = ThemeConfig.currentTheme.ButtonContrast
|
containerColor = ThemeConfig.currentTheme.ButtonContrast
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
ButtonDefaults.filledTonalButtonColors()
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
modifier = Modifier.size(20.dp),
|
modifier = Modifier.size(20.dp),
|
||||||
@@ -841,9 +849,6 @@ fun ModuleItem(
|
|||||||
onClick = { onUpdate(module) },
|
onClick = { onUpdate(module) },
|
||||||
shape = ButtonDefaults.textShape,
|
shape = ButtonDefaults.textShape,
|
||||||
contentPadding = ButtonDefaults.TextButtonContentPadding,
|
contentPadding = ButtonDefaults.TextButtonContentPadding,
|
||||||
colors = ButtonDefaults.filledTonalButtonColors(
|
|
||||||
containerColor = ThemeConfig.currentTheme.ButtonContrast
|
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
modifier = Modifier.size(20.dp),
|
modifier = Modifier.size(20.dp),
|
||||||
@@ -867,9 +872,13 @@ fun ModuleItem(
|
|||||||
modifier = Modifier.defaultMinSize(52.dp, 32.dp),
|
modifier = Modifier.defaultMinSize(52.dp, 32.dp),
|
||||||
onClick = { onUninstallClicked(module) },
|
onClick = { onUninstallClicked(module) },
|
||||||
contentPadding = ButtonDefaults.TextButtonContentPadding,
|
contentPadding = ButtonDefaults.TextButtonContentPadding,
|
||||||
colors = ButtonDefaults.filledTonalButtonColors(
|
colors = if (!ThemeConfig.useDynamicColor) {
|
||||||
|
ButtonDefaults.filledTonalButtonColors(
|
||||||
containerColor = ThemeConfig.currentTheme.ButtonContrast
|
containerColor = ThemeConfig.currentTheme.ButtonContrast
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
ButtonDefaults.filledTonalButtonColors()
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
if (!module.remove) {
|
if (!module.remove) {
|
||||||
Icon(
|
Icon(
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ sealed class ThemeColors {
|
|||||||
override val OnPrimaryContainer = Color(0xFF000000)
|
override val OnPrimaryContainer = Color(0xFF000000)
|
||||||
override val OnSecondaryContainer = Color(0xFF000000)
|
override val OnSecondaryContainer = Color(0xFF000000)
|
||||||
override val OnTertiaryContainer = Color(0xFF000000)
|
override val OnTertiaryContainer = Color(0xFF000000)
|
||||||
override val ButtonContrast = Color(0xFFFFFFFF)
|
override val ButtonContrast = Color(0xFF00BFFF)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Blue Theme
|
// Blue Theme
|
||||||
|
|||||||
Reference in New Issue
Block a user