Do not show Checked Icon On Material Components Chip Android
You can just use setCheckable and setCheckedIconVisible
Example:
for (int i = 0; i < array.size(); i++) {
KeyValueSelectedEntity letter = array.get(i);
if (getContext() != null) {
Chip chip = new Chip(getContext());
chip.setId(letter.getId());
chip.setText(letter.getName());
chip.setTag(i);
chip.setCheckable(true);
chip.setCheckedIconVisible(false);
chip.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean selected) {
Log.d(TAG, "onCheckedChanged");
int tag = (int) compoundButton.getTag();
...
}}
I managed to make it work by setting the below attirbutes in styles.xml like so:
<android.support.design.chip.Chip
android:id="@+id/chipFollowing"
style="@style/ChipCustomStyle" ...>
styles.xml
<style name="ChipCustomStyle" parent="Widget.MaterialComponents.Chip.Action">
<item name="checkedIconEnabled">false</item>
<item name="checkedIcon">@null</item>
</style>