Android Chip Custom Height Or Padding - Chipgroup spacing Android Chip Custom Height Or Padding - Chipgroup spacing android android

Android Chip Custom Height Or Padding - Chipgroup spacing


In the 1.1.0-alpha* versions extra spacing is added for the chip. After a lot of hit and trial I managed to remove that spacing using:

app:chipMinTouchTargetSize="0dp"

Looking at the class file for Chip, it seems that it's related to Android's minimum touch target size, so consider that before changing this.


Belows are the Chip Attributes for padding. Hopefully, It may help you

Paddings

app:chipStartPaddingapp:iconStartPaddingapp:iconEndPaddingapp:textStartPaddingapp:textEndPaddingapp:closeIconStartPaddingapp:closeIconEndPaddingapp:chipEndPadding

Fore more info: Click here


In order to make a Chip thinner, you need to adjust two properties: chip height and text size.

<style name="ThinnerChip" parent="Widget.MaterialComponents.Chip.Action">    <item name="chipCornerRadius">12dp</item>    <item name="chipMinHeight">24dp</item>    <item name="android:textAppearance">@style/SmallerText</item></style><style name="SmallerText" parent="TextAppearance.AppCompat.Small">    <item name="android:textSize">11sp</item></style>

Then apply the style as ussually.

<com.google.android.material.chip.Chip    style="@style/ThinnerChip"    ...    />