Reputation: 3672
I have the style for the Chip defined as below:
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
...
<item name="chipStyle">@style/TagChip</item>
</style>
<style name="TagChip" parent="Widget.MaterialComponents.Chip.Filter">
<item name="android:elevation">4dp</item>
<item name="checkedIconTint">@color/white</item>
<item name="chipBackgroundColor">@color/tag_chip_bg_color</item>
</style>
And this produces the following results:
I want to change the black checkmark icon to white.
I've tried changing the checkedIconTint
property, but it doesn't change anything.
Upvotes: 1
Views: 1725
Reputation: 202
You can set the checkedIcon programmatically like this
chip.checkedIcon?.let {
val wrappedDrawable =
DrawableCompat.wrap(it)
DrawableCompat.setTint(wrappedDrawable, Color.RED)
chip.checkedIcon = wrappedDrawable
}
Upvotes: 1