I\'m doing a list with Chips. I want this chips can be selected, so, taking a look to https://material.io/develop/android/components/chip/ I see I can have a \"Choice Chip\"
the CustomChipChoice is not a style it is just a reference to a style. therefore change R.style.CustomChipChoice to it : R.attr.CustomChipChoice
val newChip = Chip(context, null, R.attr.CustomChipChoice)
but before it you should add this CustomChipChoicein values.xml file in your project.
for this. if your project does not have the values.xml create it in values directory.
then add CustomChipChoice like this.
values.xml
now in styles.xml add your style like this.
styles.xml
now that CustomChipChoice attr references to this style
and now you can create your custom style in styles.xml file.
styles.xml
if you want to change text appearance of chip. here is ChipTextStyleAppearance. you can add it like this.
styles.xml
dont forget to add the AppTheme in androidManifest.xml on application or activity tags.
androidManifest.xml