Tweak themed icon colors
This commit is contained in:
@@ -29,9 +29,8 @@ class ThemedIconProvider(
|
|||||||
val isDarkMode =
|
val isDarkMode =
|
||||||
context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_YES != 0
|
context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_YES != 0
|
||||||
|
|
||||||
val bgAttr =
|
val bgAttr = R.attr.colorPrimaryContainer
|
||||||
if (isDarkMode) R.attr.colorOnSurfaceInverse else R.attr.colorPrimaryContainer
|
val fgAttr = R.attr.colorOnPrimaryContainer
|
||||||
val fgAttr = if (isDarkMode) R.attr.colorOnPrimaryContainer else R.attr.colorOnSurfaceVariant
|
|
||||||
bgColor = theme.resolveAttribute(bgAttr, typedValue, true).let {
|
bgColor = theme.resolveAttribute(bgAttr, typedValue, true).let {
|
||||||
typedValue.data
|
typedValue.data
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -21,9 +21,9 @@ class ThemedPlaceholderIconProvider(
|
|||||||
val isDarkMode =
|
val isDarkMode =
|
||||||
context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_YES != 0
|
context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_YES != 0
|
||||||
|
|
||||||
val bgAttr =
|
val bgAttr = R.attr.colorPrimaryContainer
|
||||||
if (isDarkMode) R.attr.colorOnSurfaceInverse else R.attr.colorPrimaryContainer
|
val fgAttr = R.attr.colorOnPrimaryContainer
|
||||||
val fgAttr = if (isDarkMode) R.attr.colorOnPrimaryContainer else R.attr.colorOnSurfaceVariant
|
|
||||||
bgColor = theme.resolveAttribute(bgAttr, typedValue, true).let {
|
bgColor = theme.resolveAttribute(bgAttr, typedValue, true).let {
|
||||||
typedValue.data
|
typedValue.data
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user