When put a iconColor black (for example) the icon color is other than what is settted
Closed this issue · 5 comments
jrcacd commented
When put a iconColor black (for example) the icon color is other than what is settted
zawadz88 commented
Hi @jrcacd,
Could you provide a code snippet of how you're using it and a screenshot of how it looks like, please?
Also, is this happening on any specific device, are you using Android Support Library or AndroidX?
Any details would be appreciated :)
jrcacd commented
I'm using AndroidX
Xiaomi redmi 5 plus
Android 8.1
val popupMenu = popupMenu {
section {
item {
label = R.string.change
icon = R.drawable.ic_edit_white_48px
iconColor = R.color.md_black_1000 // real black <color name="md_black_1000">#000000</color>
callback = { ... }
}
...
}
}
popupMenu.show(...)
zawadz88 commented
It might be that AppCompat does some internap tinting based on your accent color. Is the result the same if you use a different icon, preferably one that's in your app assets?
jrcacd commented
Yes
zawadz88 commented
OK, I think I see the issue now. You should be using a color int and not a color resource ID. So in your case this could be:
iconColor = ContextCompat.getColor(context, R.color. md_black_1000)