From 967485bd449ff69ddb21050558a7305a03eafcb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Wed, 30 Aug 2023 13:50:32 +0200 Subject: [PATCH] Use same color as surrounding buttons for inactive emoji category icon --- .../com/simplemobiletools/keyboard/views/MyKeyboardView.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt index e3ab2f7..4b01757 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt @@ -1560,6 +1560,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut allItems.addAll(emojis.map(EmojisAdapter.Item::Emoji)) } val checkIds = mutableMapOf() + val inactiveColor = mTextColor.darkenColor() keyboardViewBinding?.emojiCategoriesStrip?.apply { weightSum = categories.count().toFloat() val strip = this @@ -1576,7 +1577,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut ) root.setOnClickListener { strip.children.filterIsInstance().forEach { - it.imageTintList = ColorStateList.valueOf(context.getProperTextColor()) + it.imageTintList = ColorStateList.valueOf(inactiveColor) } root.imageTintList = ColorStateList.valueOf(context.getProperPrimaryColor()) (keyboardViewBinding?.emojisList?.layoutManager as? GridLayoutManager)?.scrollToPositionWithOffset( @@ -1584,7 +1585,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut 0 ) } - root.imageTintList = ColorStateList.valueOf(context.getProperTextColor()) + root.imageTintList = ColorStateList.valueOf(inactiveColor) } } } @@ -1620,7 +1621,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut if (it.id == id) { it.imageTintList = ColorStateList.valueOf(context.getProperPrimaryColor()) } else { - it.imageTintList = ColorStateList.valueOf(context.getProperTextColor()) + it.imageTintList = ColorStateList.valueOf(inactiveColor) } } }