Reputation: 313
I'm trying to use ChipGroup that hold some Chips with text only. everything works fine. the problem starts when there is short text. for some reason the text doesn't fill the chip itself, and i can't fix that...
I'm using this layout for Chip:
<com.daytwo.core.widget.CustomChip
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/chip"
style="@style/Chip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="64dp"/>
And my style is:
<style name="Chip" parent="@style/Widget.MaterialComponents.Chip.Choice">
<item name="android:textColor">@color/black</item>
<item name="chipBackgroundColor">@color/background</item>
<item name="rippleColor">@color/ripple</item>
<item name="chipStrokeWidth">2dp</item>
<item name="chipMinHeight">50dp</item>
</style>
Upvotes: 1
Views: 876
Reputation: 363667
This Chip
has a chipMinTouchTargetSize
.This affects both the vertical and horizontal margin of a chip to ensure that it is at least 48x48dp
.
You can disable it using app:ensureMinTouchTargetSize="false"
in each chip of the ChipGroup
.
Upvotes: 4