Skip to content

Commit 967485b

Browse files
committed
Use same color as surrounding buttons for inactive emoji category icon
1 parent 7cb5fbe commit 967485b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,6 +1560,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
15601560
allItems.addAll(emojis.map(EmojisAdapter.Item::Emoji))
15611561
}
15621562
val checkIds = mutableMapOf<Int, String>()
1563+
val inactiveColor = mTextColor.darkenColor()
15631564
keyboardViewBinding?.emojiCategoriesStrip?.apply {
15641565
weightSum = categories.count().toFloat()
15651566
val strip = this
@@ -1576,15 +1577,15 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
15761577
)
15771578
root.setOnClickListener {
15781579
strip.children.filterIsInstance<ImageButton>().forEach {
1579-
it.imageTintList = ColorStateList.valueOf(context.getProperTextColor())
1580+
it.imageTintList = ColorStateList.valueOf(inactiveColor)
15801581
}
15811582
root.imageTintList = ColorStateList.valueOf(context.getProperPrimaryColor())
15821583
(keyboardViewBinding?.emojisList?.layoutManager as? GridLayoutManager)?.scrollToPositionWithOffset(
15831584
allItems.indexOfFirst { it is EmojisAdapter.Item.Category && it.value == category },
15841585
0
15851586
)
15861587
}
1587-
root.imageTintList = ColorStateList.valueOf(context.getProperTextColor())
1588+
root.imageTintList = ColorStateList.valueOf(inactiveColor)
15881589
}
15891590
}
15901591
}
@@ -1620,7 +1621,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
16201621
if (it.id == id) {
16211622
it.imageTintList = ColorStateList.valueOf(context.getProperPrimaryColor())
16221623
} else {
1623-
it.imageTintList = ColorStateList.valueOf(context.getProperTextColor())
1624+
it.imageTintList = ColorStateList.valueOf(inactiveColor)
16241625
}
16251626
}
16261627
}

0 commit comments

Comments
 (0)