mirror of
https://github.com/SimpleMobileTools/Simple-Keyboard.git
synced 2025-02-16 11:50:41 +01:00
Use same color as surrounding buttons for inactive emoji category icon
This commit is contained in:
parent
7cb5fbe8a2
commit
967485bd44
@ -1560,6 +1560,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
|
||||
allItems.addAll(emojis.map(EmojisAdapter.Item::Emoji))
|
||||
}
|
||||
val checkIds = mutableMapOf<Int, String>()
|
||||
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<ImageButton>().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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user