How do I create a chip with choice style programma...
# compose-ui-showcase
r
How do I create a chip with choice style programmatically?
Copy code
<com.google.android.material.chip.Chip
  android:id="@+id/chip_1"
  style="@style/Widget.MaterialComponents.Chip.Choice"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:checked="true"
  android:text="Test" />

// tried this but it doesn't work
Chip(context, null, R.style.Widget_MaterialComponents_Chip_Choice)
1
t
Yeah that won't work... Not really an expert on this topic but someone asked this on SO https://stackoverflow.com/questions/53557863/change-chip-widget-style-programmatically-not-working-android You might want to have a look at the responses and implement it to your liking
r
Thanks
👍 1
t
@Rob No problem, thank you for being on this #android-ui channel 🙂
618 Views