How do I set the selected com.google.android.material.chip.Chip color? I don\'t want it to be the default gray. This is a single selection chip group.
Original
As others mentioned, you need to set the background color property of the chip element to a ColorStateList that you define. But I just wanted to point out an important note on how to do that since I ran into issues getting the different states to work.
When defining your own ColorStateList (xml resource) you need to make sure you set the different state options in the ColorStateList BEFORE the default color! This was tripping me up for a few days before I figured it out, so I hope this helps someone else as well.
Also, your chip needs to be clickable and focusable (checkable didn't work for me) so set these properties to true as well.
If you want to programmatically set different ColorStateOptions you can do that like so:
binding.myChip.chipBackgroundColor = resources.getColorStateList(R.color.chip_color_state_list)