From 2665df2fff27aa4031176a78f4934b014f792553 Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Mon, 14 Feb 2022 22:49:06 +0100 Subject: [PATCH] Tweak themed icon colors --- .../de/mm20/launcher2/icons/providers/ThemedIconProvider.kt | 5 ++--- .../icons/providers/ThemedPlaceholderIconProvider.kt | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/icons/src/main/java/de/mm20/launcher2/icons/providers/ThemedIconProvider.kt b/icons/src/main/java/de/mm20/launcher2/icons/providers/ThemedIconProvider.kt index 4c553e38..bdb1f551 100644 --- a/icons/src/main/java/de/mm20/launcher2/icons/providers/ThemedIconProvider.kt +++ b/icons/src/main/java/de/mm20/launcher2/icons/providers/ThemedIconProvider.kt @@ -29,9 +29,8 @@ class ThemedIconProvider( val isDarkMode = context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_YES != 0 - val bgAttr = - if (isDarkMode) R.attr.colorOnSurfaceInverse else R.attr.colorPrimaryContainer - val fgAttr = if (isDarkMode) R.attr.colorOnPrimaryContainer else R.attr.colorOnSurfaceVariant + val bgAttr = R.attr.colorPrimaryContainer + val fgAttr = R.attr.colorOnPrimaryContainer bgColor = theme.resolveAttribute(bgAttr, typedValue, true).let { typedValue.data } diff --git a/icons/src/main/java/de/mm20/launcher2/icons/providers/ThemedPlaceholderIconProvider.kt b/icons/src/main/java/de/mm20/launcher2/icons/providers/ThemedPlaceholderIconProvider.kt index 20bb6e8d..eed0f610 100644 --- a/icons/src/main/java/de/mm20/launcher2/icons/providers/ThemedPlaceholderIconProvider.kt +++ b/icons/src/main/java/de/mm20/launcher2/icons/providers/ThemedPlaceholderIconProvider.kt @@ -21,9 +21,9 @@ class ThemedPlaceholderIconProvider( val isDarkMode = context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_YES != 0 - val bgAttr = - if (isDarkMode) R.attr.colorOnSurfaceInverse else R.attr.colorPrimaryContainer - val fgAttr = if (isDarkMode) R.attr.colorOnPrimaryContainer else R.attr.colorOnSurfaceVariant + val bgAttr = R.attr.colorPrimaryContainer + val fgAttr = R.attr.colorOnPrimaryContainer + bgColor = theme.resolveAttribute(bgAttr, typedValue, true).let { typedValue.data }