Themed icons: swap colors in dark mode
This commit is contained in:
parent
73d65d1a30
commit
be0ea2cfe6
@ -31,8 +31,8 @@ class ThemedIconProvider(
|
|||||||
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 =
|
||||||
if (isDarkMode) R.attr.colorOnPrimaryContainer else R.attr.colorPrimaryContainer
|
if (isDarkMode) R.attr.colorOnSurfaceInverse else R.attr.colorPrimaryContainer
|
||||||
val fgAttr = if (isDarkMode) R.attr.colorOnSurfaceInverse else R.attr.colorOnSurfaceVariant
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,8 +22,8 @@ class ThemedPlaceholderIconProvider(
|
|||||||
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 =
|
||||||
if (isDarkMode) R.attr.colorOnPrimaryContainer else R.attr.colorPrimaryContainer
|
if (isDarkMode) R.attr.colorOnSurfaceInverse else R.attr.colorPrimaryContainer
|
||||||
val fgAttr = if (isDarkMode) R.attr.colorOnSurfaceInverse else R.attr.colorOnSurfaceVariant
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user