# ChipDrawable

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/chip/ChipDrawable.java)

*** ** * ** ***


```
public class ChipDrawable extends MaterialShapeDrawable
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [com.google.android.material.shape.MaterialShapeDrawable](https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable) ||
|   | ↳ | [com.google.android.material.chip.ChipDrawable](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable) |

*** ** * ** ***

ChipDrawable contains all the layout and draw logic for `https://developer.android.com/reference/com/google/android/material/chip/Chip`.

You can use ChipDrawable directly in contexts that require a Drawable. For example, an auto-complete enabled EditText can replace snippets of text with a ChipDrawable to represent it as a semantic entity. To create an instance of ChipDrawable, use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#createFromResource(Context,int)` and pass in an XML resource in this form:

```
<chip xmlns:app="http://schemas.android.com/apk/res-auto"
    android:text="Hello, World!"/>
```

The basic attributes you can set are:

- android:checkable - If true, the chip can be toggled. If false, the chip acts like a button.
- android:text - Sets the text of the chip.
- `app:chipIcon` - Sets the icon of the chip, or use @null to display no icon. Usually on the left.
- `app:checkedIcon` - Sets a custom icon to use when checked, or use @null to display no icon. Usually on the left.
- `app:closeIcon` - Sets a custom icon that the user can click to close, or use @null to display no icon. Usually on the right.
- ellipsize - Does not support MARQUEE because chip text should not scroll.

When used in this stand-alone mode, the host view must explicitly manage the ChipDrawable's state:

- setBounds, taking into account `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getIntrinsicHeight()` and `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getIntrinsicWidth()`.
- `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#draw(Canvas)`
- setCallback, to support invalidations on the chip drawable or any of its child drawables. This includes animations.
- setState, to support checking the chip, and touch/mouse/keyboard interactions on the chip.
- `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconState(int[])`, to support touch, mouse, or keyboard interactions on the close icon.
- setHotspot
- setLayoutDirection, to support RTL mode.

ChipDrawable's horizontal layout is as follows:

```
  chipStartPadding     iconEndPadding     closeIconStartPadding         chipEndPadding
   +                    +                                    +                      +
   |                    |                                    |                      |
   |  iconStartPadding  |  textStartPadding   textEndPadding | closeIconEndPadding  |
   |   +                |    +                            +  |                  +   |
   |   |                |    |                            |  |                  |   |
   v   v                v    v                            v  v                  v   v
+---+---+---+---+---+---+---+---+---+---+---+
|     |    |       XX  |    |    |  XX   X  X  X  XXX  |    |    | X      X |    |     |
|     |    |      XX   |    |    | X  X  X  X  X  X  X |    |    |  XX  XX  |    |     |
|     |    |  XX XX    |    |    | X     XXXX  X  XXX  |    |    |    XX    |    |     |
|     |    |   XXX     |    |    | X  X  X  X  X  X    |    |    |  XX  XX  |    |     |
|     |    |    X      |    |    |  XX   X  X  X  X    |    |    | X      X |    |     |
+---+---+---+---+---+---+---+---+---+---+---+
                 ^                           ^                         ^
                 |                           |                         |
                 +                           +                         +
            chipIconSize                  *dynamic*              closeIconSize
```

ChipDrawable contains three child drawables: `chipIcon`, `checkedIcon`, and `
closeIcon`. chipIcon and checkedIcon inherit the state of this drawable, but closeIcon contains its own state that you can set with `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconState(int[])`.

For more information, see the [component developer guidance](https://github.com/material-components/material-components-android/blob/master/docs/components/Chip.md) and [design guidelines](https://material.io/components/chips/overview).

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/Chip` |   |

## Summary

| ### Nested types |
|---|
| `public interface https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable.Delegate` Delegate interface to be implemented by Views that own a ChipDrawable. |

| ### Public fields |
|---|---|
| `int` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#alpha()` |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#checkedIcon()` |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#checkedIconTint()` |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#chipBackgroundColor()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#chipCornerRadius()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#chipEndPadding()` Padding at the end of the chip, after the close icon. |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#chipIcon()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#chipIconSize()` |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#chipIconTint()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#chipMinHeight()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#chipStartPadding()` Padding at the start of the chip, before the icon. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#chipStrokeColor()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#chipStrokeWidth()` |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#closeIcon()` |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#closeIconContentDescription()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#closeIconEndPadding()` Padding at the end of the close icon, before the end of the chip. |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#closeIconSize()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#closeIconStartPadding()` Padding at the start of the close icon, after the text. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#closeIconTint()` |
| `ColorFilter` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#colorFilter()` |
| `https://developer.android.com/reference/com/google/android/material/animation/MotionSpec` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#hideMotionSpec()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#iconEndPadding()` Padding at the end of the icon, before the text. |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#iconStartPadding()` Padding at the start of the icon, after the start of the chip. |
| `int` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#maxWidth()` |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#rippleColor()` |
| `https://developer.android.com/reference/com/google/android/material/animation/MotionSpec` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#showMotionSpec()` |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#text()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#textEndPadding()` Padding at the end of the text, before the close icon. |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#textStartPadding()` Padding at the start of the text, after the icon. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#useCompatRipple()` |

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#createFromAttributes(Context,AttributeSet,int,int)( Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes )` Returns a ChipDrawable from the given attributes. |
| `static https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#createFromResource(Context,int)(Context context, int id)` Returns a ChipDrawable from the given XML resource. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#draw(Canvas)(Canvas canvas)` |
| `int` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getAlpha()()` |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getCheckedIcon()()` Returns this chip's checked icon. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getCheckedIconTint()()` Returns the android.content.res.ColorStateList used to tint the checked icon. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getChipBackgroundColor()()` Returns this chip's background color. |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getChipCornerRadius()()` Returns this chip's corner radius. |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getChipEndPadding()()` Returns this chip's end padding. |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getChipIcon()()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getChipIconSize()()` Returns this chip's icon size. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getChipIconTint()()` Returns the android.content.res.ColorStateList used to tint the chip icon. |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getChipMinHeight()()` Returns this chip's minimum height. |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getChipStartPadding()()` Returns this chip's start padding. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getChipStrokeColor()()` Returns this chip's stroke color. |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getChipStrokeWidth()()` Returns this chip's stroke width. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getChipTouchBounds(RectF)(RectF bounds)` Returns the chip's ChipDrawable-absolute bounds (top-left is ` [ChipDrawable.getBounds().left, ChipDrawable.getBounds().top]`). |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getCloseIcon()()` |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getCloseIconContentDescription()()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getCloseIconEndPadding()()` Returns the end padding for this chip's close icon. |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getCloseIconSize()()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getCloseIconStartPadding()()` Returns the start padding for this chip's close icon. |
| `int[]` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getCloseIconState()()` Describes the current state of the close icon. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getCloseIconTint()()` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getCloseIconTouchBounds(RectF)(RectF bounds)` Returns the close icon's ChipDrawable-absolute bounds (top-left is ` [ChipDrawable.getBounds().left, ChipDrawable.getBounds().top]`). |
| `ColorFilter` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getColorFilter()()` |
| `TruncateAt` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getEllipsize()()` |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getFontVariationSettings()()` |
| `https://developer.android.com/reference/com/google/android/material/animation/MotionSpec` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getHideMotionSpec()()` Returns this chip's hide motion spec. |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getIconEndPadding()()` Returns the end padding for this chip's icon. |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getIconStartPadding()()` Returns the start padding for this chip's icon. |
| `int` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getIntrinsicHeight()()` Returns the height at which the chip would like to be laid out. |
| `int` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getIntrinsicWidth()()` Returns the width at which the chip would like to be laid out. |
| `int` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getMaxWidth()()` Returns the maximum width of TextView in terms of pixels. |
| `int` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getOpacity()()` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getOutline(Outline)(Outline outline)` |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getRippleColor()()` Returns this chip's ripple color. |
| `https://developer.android.com/reference/com/google/android/material/animation/MotionSpec` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getShowMotionSpec()()` Returns this chip's show motion spec. |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getText()()` |
| `https://developer.android.com/reference/com/google/android/material/resources/TextAppearance` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getTextAppearance()()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getTextEndPadding()()` Returns the end padding for this chip's text. |
| `float` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getTextStartPadding()()` Returns the start padding for this chip's text. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#getUseCompatRipple()()` Returns whether this ChipDrawable should draw its own compatibility ripples. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#invalidateDrawable(Drawable)(Drawable who)` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isCheckable()()` |
| `boolean` | `[isCheckedIconEnabled](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isCheckedIconEnabled())()` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isCheckedIconVisible()` instead. <br /> |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isCheckedIconVisible()()` |
| `boolean` | `[isChipIconEnabled](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isChipIconEnabled())()` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isChipIconVisible()` instead. <br /> |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isChipIconVisible()()` |
| `boolean` | `[isCloseIconEnabled](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isCloseIconEnabled())()` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isCloseIconVisible()` instead. <br /> |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isCloseIconStateful()()` Indicates whether the close icon drawable will change its appearance based on state. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isCloseIconVisible()()` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isStateful()()` Indicates whether this chip drawable will change its appearance based on state. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#onLayoutDirectionChanged(int)(int layoutDirection)` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#onStateChange(int[])(int[] state)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#onTextSizeChange()()` Handles a change in the text's size. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#scheduleDrawable(Drawable,java.lang.Runnable,long)(Drawable who, https://developer.android.com/reference/java/lang/Runnable what, long when)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setAlpha(int)(int alpha)` Sets the alpha of this ChipDrawable. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckable(boolean)(boolean checkable)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckableResource(int)(int id)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckedIcon(Drawable)(Drawable checkedIcon)` Sets this chip's checked icon. |
| `void` | `[setCheckedIconEnabled](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckedIconEnabled(boolean))(boolean checkedIconEnabled)` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckedIconVisible(boolean)` instead. <br /> |
| `void` | `[setCheckedIconEnabledResource](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckedIconEnabledResource(int))(int id)` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckedIconVisible(int)` instead. <br /> |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckedIconResource(int)(int id)` Sets this chip's checked icon using a resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckedIconTint(ColorStateList)(ColorStateList checkedIconTint)` Sets the checked icon's color tint using the specified android.content.res.ColorStateList. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckedIconTintResource(int)(int id)` Sets the checked icon's color tint using a resource ID. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckedIconVisible(boolean)(boolean checkedIconVisible)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckedIconVisible(int)(int id)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipBackgroundColor(ColorStateList)(ColorStateList chipBackgroundColor)` Sets this chip's background color. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipBackgroundColorResource(int)(int id)` Sets this chip's background color using a resource id. |
| `void` | `[setChipCornerRadius](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipCornerRadius(float))(float chipCornerRadius)` **This method is deprecated.** call `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel#withCornerSize(float)` or call `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel#toBuilder()` on the `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getShapeAppearanceModel()`, modify the shape using the builder and then call `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setShapeAppearanceModel(com.google.android.material.shape.ShapeAppearanceModel)`. <br /> |
| `void` | `[setChipCornerRadiusResource](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipCornerRadiusResource(int))(int id)` **This method is deprecated.** call `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel#withCornerSize(float)` or call `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel#toBuilder()` on the `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getShapeAppearanceModel()`, modify the shape using the builder and then call `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setShapeAppearanceModel(com.google.android.material.shape.ShapeAppearanceModel)`. <br /> |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipEndPadding(float)(float chipEndPadding)` Sets this chip's end padding. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipEndPaddingResource(int)(int id)` Sets this chip's end padding using a resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIcon(Drawable)(Drawable chipIcon)` |
| `void` | `[setChipIconEnabled](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconEnabled(boolean))(boolean chipIconEnabled)` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconVisible(boolean)` instead. <br /> |
| `void` | `[setChipIconEnabledResource](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconEnabledResource(int))(int id)` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconVisible(int)` instead. <br /> |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconResource(int)(int id)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconSize(float)(float chipIconSize)` Sets this chip icon's size. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconSizeResource(int)(int id)` Sets this chip icon's size using a resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconTint(ColorStateList)(ColorStateList chipIconTint)` Sets the chip icon's color tint using the specified android.content.res.ColorStateList. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconTintResource(int)(int id)` Sets the chip icon's color tint using a resource ID. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconVisible(boolean)(boolean chipIconVisible)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconVisible(int)(int id)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipMinHeight(float)(float chipMinHeight)` Sets this chip's minimum height. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipMinHeightResource(int)(int id)` Sets this chip's minimum height using a resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipStartPadding(float)(float chipStartPadding)` Sets this chip's start padding. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipStartPaddingResource(int)(int id)` Sets this chip's start padding using a resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipStrokeColor(ColorStateList)(ColorStateList chipStrokeColor)` Sets this chip's stroke color. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipStrokeColorResource(int)(int id)` Sets this chip's stroke color using a resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipStrokeWidth(float)(float chipStrokeWidth)` Sets this chip's stroke width. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipStrokeWidthResource(int)(int id)` Sets this chip's stroke width using a resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIcon(Drawable)(Drawable closeIcon)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconContentDescription(java.lang.CharSequence)( https://developer.android.com/reference/java/lang/CharSequence closeIconContentDescription )` |
| `void` | `[setCloseIconEnabled](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconEnabled(boolean))(boolean closeIconEnabled)` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconVisible(int)` instead. <br /> |
| `void` | `[setCloseIconEnabledResource](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconEnabledResource(int))(int id)` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconVisible(int)` instead. <br /> |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconEndPadding(float)(float closeIconEndPadding)` Sets the end padding for this chip's close icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconEndPaddingResource(int)(int id)` Sets the end padding for this chip's close icon using a resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconResource(int)(int id)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconSize(float)(float closeIconSize)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconSizeResource(int)(int id)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconStartPadding(float)(float closeIconStartPadding)` Sets the start padding for this chip's close icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconStartPaddingResource(int)(int id)` Sets the start padding for this chip's close icon using a resource id. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconState(int[])(int[] stateSet)` Specify a set of states for the close icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconTint(ColorStateList)(ColorStateList closeIconTint)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconTintResource(int)(int id)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconVisible(boolean)(boolean closeIconVisible)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconVisible(int)(int id)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setColorFilter(ColorFilter)(ColorFilter colorFilter)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setDelegate(com.google.android.material.chip.ChipDrawable.Delegate)(https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable.Delegate delegate)` Sets the View delegate that owns this ChipDrawable. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setEllipsize(TruncateAt)(TruncateAt truncateAt)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setFontVariationSettings(java.lang.String)(https://developer.android.com/reference/java/lang/String fontVariationSettings)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setHideMotionSpec(com.google.android.material.animation.MotionSpec)(https://developer.android.com/reference/com/google/android/material/animation/MotionSpec hideMotionSpec)` Sets this chip's hide motion spec. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setHideMotionSpecResource(int)(int id)` Sets this chip's hide motion spec using a resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setIconEndPadding(float)(float iconEndPadding)` Sets the end padding for this chip's icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setIconEndPaddingResource(int)(int id)` Sets the end padding for this chip's icon using a resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setIconStartPadding(float)(float iconStartPadding)` Sets this chip's icon start padding. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setIconStartPaddingResource(int)(int id)` Sets the start padding for this chip's icon using a resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setMaxWidth(int)(int maxWidth)` Sets the width of the TextView to be exactly `pixels` wide. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setRippleColor(ColorStateList)(ColorStateList rippleColor)` Sets this chip's ripple color. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setRippleColorResource(int)(int id)` Sets this chip's ripple color using a resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setShowMotionSpec(com.google.android.material.animation.MotionSpec)(https://developer.android.com/reference/com/google/android/material/animation/MotionSpec showMotionSpec)` Sets this chip's show motion spec. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setShowMotionSpecResource(int)(int id)` Sets this chip's show motion spec using a resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setText(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence text)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setTextAppearance(com.google.android.material.resources.TextAppearance)(https://developer.android.com/reference/com/google/android/material/resources/TextAppearance textAppearance)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setTextAppearanceResource(int)(int id)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setTextColor(ColorStateList)(ColorStateList color)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setTextColor(int)(int color)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setTextEndPadding(float)(float textEndPadding)` Sets the end padding for this chip's text. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setTextEndPaddingResource(int)(int id)` Sets the end padding for this chip's text using a resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setTextResource(int)(int id)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setTextSize(float)(float size)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setTextStartPadding(float)(float textStartPadding)` Sets the start padding for this chip's text. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setTextStartPaddingResource(int)(int id)` Sets the start padding for this chip's text using a resource id. |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setTintList(ColorStateList)(ColorStateList tint)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setTintMode(Mode)(Mode tintMode)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setUseCompatRipple(boolean)(boolean useCompatRipple)` Sets whether this ChipDrawable should draw its own compatibility ripples. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setVisible(boolean,boolean)(boolean visible, boolean restart)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#unscheduleDrawable(Drawable,java.lang.Runnable)(Drawable who, https://developer.android.com/reference/java/lang/Runnable what)` |

| ### Protected methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#onLevelChange(int)(int level)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#onSizeChange()()` Attempts to call `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable.Delegate#onChipDrawableSizeChange()` on the delegate. |

| ### Inherited Constants |
|---|
| From [com.google.android.material.shape.MaterialShapeDrawable](https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable) |---|---| | `static final int` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#SHADOW_COMPAT_MODE_ALWAYS() = 2` Always draw fake shadows, never draw native elevation shadows. | | `static final int` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#SHADOW_COMPAT_MODE_DEFAULT() = 0` Try to draw native elevation shadows if possible, otherwise use fake shadows. | | `static final int` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#SHADOW_COMPAT_MODE_NEVER() = 1` Never draw fake shadows. | |

| ### Inherited fields |
|---|
| From [com.google.android.material.shape.MaterialShapeDrawable](https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable) |---|---| | `int` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#resolvedTintColor()` | | `final Region` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#transparentRegion()` | |

| ### Inherited methods |
|---|
| From [com.google.android.material.shape.MaterialShapeDrawable](https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable) |---|---| | `int` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#compositeElevationOverlayIfNeeded(int)(int backgroundColor)` | | `static https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#createWithElevationOverlay(Context)(Context context)` Returns a `MaterialShapeDrawable` with the elevation overlay functionality initialized, a fill color of `colorSurface`, and an elevation of 0. | | `static https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#createWithElevationOverlay(Context,float)(Context context, float elevation)` Returns a `MaterialShapeDrawable` with the elevation overlay functionality initialized, a fill color of `colorSurface`, and an elevation of `elevation`. | | `static https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#createWithElevationOverlay(Context,float,ColorStateList)( Context context, float elevation, ColorStateList backgroundTint )` Returns a `MaterialShapeDrawable` with the elevation overlay functionality initialized, a fill color of `backgroundTint`, and an elevation of `elevation`. | | `float` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getBottomLeftCornerResolvedSize()()` Returns the actual size of the bottom left corner for the current bounds. | | `float` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getBottomRightCornerResolvedSize()()` Returns the actual size of the bottom right corner for the current bounds. | | `RectF` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getBoundsAsRectF()()` | | `ConstantState` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getConstantState()()` | | `float` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getElevation()()` Returns the elevation used to render both fake shadows when `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#requiresCompatShadow()` is true and elevation overlays. | | `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getFillColor()()` Get the color used for the fill. | | `float` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getInterpolation()()` Get the interpolation of the path, between 0 and 1. | | `boolean` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getPadding(Rect)(Rect padding)` | | `Style` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getPaintStyle()()` Get the current style used by the shape's paint. | | `float` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getParentAbsoluteElevation()()` Returns the parent absolute elevation. | | `void` | `[getPathForSize](https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getPathForSize(int,int,Path))(int width, int height, Path path)` **This method is deprecated.** see `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearancePathProvider` <br /> | | `int` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getResolvedTintColor()()` Get the tint color factoring in any other runtime modifications such as elevation overlays. | | `float` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getScale()()` Get the scale of the rendered path. | | `int` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getShadowCompatRotation()()` Returns the rotation offset applied to the fake shadow which is drawn when `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#requiresCompatShadow()` is true. | | `int` | `@https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable.CompatibilityShadowMode https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getShadowCompatibilityMode()()` | | `int` | `[getShadowElevation](https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getShadowElevation())()` **This method is deprecated.** use `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getElevation()` instead. <br /> | | `int` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getShadowOffsetX()()` Returns the X offset of the shadow from the bounds of the shape. | | `int` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getShadowOffsetY()()` Returns the Y offset of the shadow from the bounds of the shape. | | `int` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getShadowRadius()()` Get the shadow radius rendered by the path in pixels. | | `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getShapeAppearanceModel()()` Get the `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel` containing the path that will be rendered in this drawable. | | `https://developer.android.com/reference/com/google/android/material/shape/ShapePathModel` | `[getShapedViewModel](https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getShapedViewModel())()` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getShapeAppearanceModel()` instead. <br /> | | `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getStrokeColor()()` Get the color used for the stroke. | | `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getStrokeTintList()()` Get the stroke's current ColorStateList. | | `float` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getStrokeWidth()()` Get the stroke width used by the shape's paint. | | `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getTintList()()` Get the tint list used by the shape's paint. | | `float` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getTopLeftCornerResolvedSize()()` Returns the actual size of the top left corner for the current bounds. | | `float` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getTopRightCornerResolvedSize()()` Returns the actual size of the top right corner for the current bounds. | | `float` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getTranslationZ()()` Returns the translationZ used to render both fake shadows when `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#requiresCompatShadow()` is true and elevation overlays. | | `Region` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getTransparentRegion()()` | | `float` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getZ()()` Returns the visual z position of this drawable, in pixels. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#initializeElevationOverlay(Context)(Context context)` Initializes the elevation overlay functionality for this drawable. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#invalidateSelf()()` | | `boolean` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#isElevationOverlayEnabled()()` Returns whether the elevation overlay functionality is initialized and enabled in this drawable's theme context. | | `boolean` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#isElevationOverlayInitialized()()` Returns whether the elevation overlay functionality has been initialized for this drawable. | | `boolean` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#isPointInTransparentRegion(int,int)(int x, int y)` Determines whether a point is contained within the transparent region of the Drawable. | | `boolean` | `[isShadowEnabled](https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#isShadowEnabled())()` **This method is deprecated.** use `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getShadowCompatibilityMode()` instead <br /> | | `Drawable` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#mutate()()` | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#onBoundsChange(Rect)(Rect bounds)` | | `boolean` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#requiresCompatShadow()()` Returns true if compat shadows should be drawn. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setAlpha(int)(int alpha)` | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setCornerSize(com.google.android.material.shape.CornerSize)(https://developer.android.com/reference/com/google/android/material/shape/CornerSize cornerSize)` Updates the corners for the given `https://developer.android.com/reference/com/google/android/material/shape/CornerSize`. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setCornerSize(float)(float cornerSize)` Updates the corners for the given `https://developer.android.com/reference/com/google/android/material/shape/CornerSize`. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setEdgeIntersectionCheckEnable(boolean)(boolean enable)` | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setElevation(float)(float elevation)` Sets the elevation used to render both fake shadows when `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#requiresCompatShadow()` is true and elevation overlays. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setFillColor(ColorStateList)(ColorStateList fillColor)` Set the color used for the fill. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setInterpolation(float)(float interpolation)` Set the interpolation of the path, between 0 and 1. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setPadding(int,int,int,int)(int left, int top, int right, int bottom)` Configure the padding of the shape | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setPaintStyle(Style)(Style paintStyle)` Set the style used by the shape's paint. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setParentAbsoluteElevation(float)(float parentAbsoluteElevation)` Sets the parent absolute elevation, which is used to render elevation overlays. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setScale(float)(float scale)` Set the scale of the rendered path. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setShadowBitmapDrawingEnable(boolean)(boolean enable)` | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setShadowColor(int)(int shadowColor)` Set the color of fake shadow rendered behind the shape. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setShadowCompatRotation(int)(int shadowRotation)` Set the rotation offset applied to the fake shadow which is drawn when `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#requiresCompatShadow()` is true. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setShadowCompatibilityMode(int)( @https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable.CompatibilityShadowMode int mode )` Set the shadow compatibility mode. | | `void` | `[setShadowElevation](https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setShadowElevation(int))(int shadowElevation)` **This method is deprecated.** use `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setElevation(float)` instead. <br /> | | `void` | `[setShadowEnabled](https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setShadowEnabled(boolean))(boolean shadowEnabled)` **This method is deprecated.** use `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setShadowCompatibilityMode(int)` instead. <br /> | | `void` | `[setShadowRadius](https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setShadowRadius(int))(int shadowRadius)` **This method is deprecated.** use `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setElevation(float)` instead. <br /> | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setShapeAppearanceModel(com.google.android.material.shape.ShapeAppearanceModel)(https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel shapeAppearanceModel)` Set the `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel` containing the path that will be rendered in this drawable. | | `void` | `[setShapedViewModel](https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setShapedViewModel(com.google.android.material.shape.ShapePathModel))(https://developer.android.com/reference/com/google/android/material/shape/ShapePathModel shapedViewModel)` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setShapeAppearanceModel(com.google.android.material.shape.ShapeAppearanceModel)` instead. <br /> | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setStroke(float,ColorStateList)(float strokeWidth, ColorStateList strokeColor)` Set the shape's stroke width and stroke color using a ColorStateList. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setStroke(float,int)(float strokeWidth, int strokeColor)` Set the shape's stroke width and stroke color. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setStrokeColor(ColorStateList)(ColorStateList strokeColor)` Set the color used for the stroke. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setStrokeTint(int)(int tintColor)` Set the shape's stroke color. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setStrokeTint(ColorStateList)(ColorStateList tintList)` Set the shape's stroke ColorStateList | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setStrokeWidth(float)(float strokeWidth)` Set the stroke width used by the shape's paint. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setTint(int)(int tintColor)` | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setTranslationZ(float)(float translationZ)` Sets the translationZ used to render both fake shadows when `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#requiresCompatShadow()` is true and elevation overlays. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setUseTintColorForShadow(boolean)(boolean useTintColorForShadow)` Set whether fake shadow color should match next set tint color. | | `void` | `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setZ(float)(float z)` Sets the visual z position of this view, in pixels. | |

## Public fields

### alpha

```
public int alpha
```

### checkedIcon

```
public Drawable checkedIcon
```

### checkedIconTint

```
public ColorStateList checkedIconTint
```

### chipBackgroundColor

```
public ColorStateList chipBackgroundColor
```

### chipCornerRadius

```
public float chipCornerRadius
```

### chipEndPadding

```
public float chipEndPadding
```

Padding at the end of the chip, after the close icon.

### chipIcon

```
public Drawable chipIcon
```

### chipIconSize

```
public float chipIconSize
```

### chipIconTint

```
public ColorStateList chipIconTint
```

### chipMinHeight

```
public float chipMinHeight
```

### chipStartPadding

```
public float chipStartPadding
```

Padding at the start of the chip, before the icon.

### chipStrokeColor

```
public ColorStateList chipStrokeColor
```

### chipStrokeWidth

```
public float chipStrokeWidth
```

### closeIcon

```
public Drawable closeIcon
```

### closeIconContentDescription

```
public CharSequence closeIconContentDescription
```

### closeIconEndPadding

```
public float closeIconEndPadding
```

Padding at the end of the close icon, before the end of the chip. If close icon exists.

### closeIconSize

```
public float closeIconSize
```

### closeIconStartPadding

```
public float closeIconStartPadding
```

Padding at the start of the close icon, after the text. If close icon exists.

### closeIconTint

```
public ColorStateList closeIconTint
```

### colorFilter

```
public ColorFilter colorFilter
```

### hideMotionSpec

```
public MotionSpec hideMotionSpec
```

### iconEndPadding

```
public float iconEndPadding
```

Padding at the end of the icon, before the text. If icon exists.

### iconStartPadding

```
public float iconStartPadding
```

Padding at the start of the icon, after the start of the chip. If icon exists.

### maxWidth

```
public int maxWidth
```

### rippleColor

```
public ColorStateList rippleColor
```

### showMotionSpec

```
public MotionSpec showMotionSpec
```

### text

```
public CharSequence text
```

### textEndPadding

```
public float textEndPadding
```

Padding at the end of the text, before the close icon.

### textStartPadding

```
public float textStartPadding
```

Padding at the start of the text, after the icon.

### useCompatRipple

```
public boolean useCompatRipple
```

## Public methods

### createFromAttributes

```
public static ChipDrawable createFromAttributes(
    Context context,
    AttributeSet attrs,
    int defStyleAttr,
    int defStyleRes
)
```

Returns a ChipDrawable from the given attributes.

### createFromResource

```
public static ChipDrawable createFromResource(Context context, int id)
```

Returns a ChipDrawable from the given XML resource. All attributes from Chip and a custom `style` attribute are supported. A chip resource may look like:

```
<chip
    xmlns:app="http://schemas.android.com/apk/res-auto"
    style="@style/Widget.MaterialComponents.Chip.Entry"
    app:chipIcon="@drawable/custom_icon"/>
```

### draw

```
public void draw(Canvas canvas)
```

### getAlpha

```
public int getAlpha()
```

### getCheckedIcon

```
public Drawable getCheckedIcon()
```

Returns this chip's checked icon.

ref com.google.android.material.R.styleable#Chip_checkedIcon

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckedIcon(Drawable)` |   |

### getCheckedIconTint

```
public ColorStateList getCheckedIconTint()
```

Returns the android.content.res.ColorStateList used to tint the checked icon.

### getChipBackgroundColor

```
public ColorStateList getChipBackgroundColor()
```

Returns this chip's background color.

ref com.google.android.material.R.styleable#Chip_chipBackgroundColor

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipBackgroundColor(ColorStateList)` |   |

### getChipCornerRadius

```
public float getChipCornerRadius()
```

Returns this chip's corner radius.

ref com.google.android.material.R.styleable#Chip_chipCornerRadius

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipCornerRadius(float)` |   |

### getChipEndPadding

```
public float getChipEndPadding()
```

Returns this chip's end padding.

ref com.google.android.material.R.styleable#Chip_chipEndPadding

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipEndPadding(float)` |   |

### getChipIcon

```
public Drawable getChipIcon()
```

### getChipIconSize

```
public float getChipIconSize()
```

Returns this chip's icon size. If a non-positive value is returned, the icon drawable's width and height (up to 24dp) will be used to measure its bounds instead.

ref com.google.android.material.R.styleable#Chip_chipIconTint

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconSize(float)` |   |

### getChipIconTint

```
public ColorStateList getChipIconTint()
```

Returns the android.content.res.ColorStateList used to tint the chip icon.

### getChipMinHeight

```
public float getChipMinHeight()
```

Returns this chip's minimum height.

ref com.google.android.material.R.styleable#Chip_chipMinHeight

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipMinHeight(float)` |   |

### getChipStartPadding

```
public float getChipStartPadding()
```

Returns this chip's start padding.

ref com.google.android.material.R.styleable#Chip_chipStartPadding

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipStartPadding(float)` |   |

### getChipStrokeColor

```
public ColorStateList getChipStrokeColor()
```

Returns this chip's stroke color.

ref com.google.android.material.R.styleable#Chip_chipStrokeColor

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipStrokeColor(ColorStateList)` |   |

### getChipStrokeWidth

```
public float getChipStrokeWidth()
```

Returns this chip's stroke width.

ref com.google.android.material.R.styleable#Chip_chipStrokeWidth

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipStrokeWidth(float)` |   |

### getChipTouchBounds

```
public void getChipTouchBounds(RectF bounds)
```

Returns the chip's ChipDrawable-absolute bounds (top-left is `
[ChipDrawable.getBounds().left, ChipDrawable.getBounds().top]`).

### getCloseIcon

```
public Drawable getCloseIcon()
```

### getCloseIconContentDescription

```
public CharSequence getCloseIconContentDescription()
```

### getCloseIconEndPadding

```
public float getCloseIconEndPadding()
```

Returns the end padding for this chip's close icon.

ref com.google.android.material.R.styleable#Chip_closeIconEndPadding

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconEndPadding(float)` |   |

### getCloseIconSize

```
public float getCloseIconSize()
```

### getCloseIconStartPadding

```
public float getCloseIconStartPadding()
```

Returns the start padding for this chip's close icon.

ref com.google.android.material.R.styleable#Chip_closeIconStartPadding

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconStartPadding(float)` |   |

### getCloseIconState

```
public int[] getCloseIconState()
```

Describes the current state of the close icon.

### getCloseIconTint

```
public ColorStateList getCloseIconTint()
```

### getCloseIconTouchBounds

```
public void getCloseIconTouchBounds(RectF bounds)
```

Returns the close icon's ChipDrawable-absolute bounds (top-left is `
[ChipDrawable.getBounds().left, ChipDrawable.getBounds().top]`).

### getColorFilter

```
public ColorFilter getColorFilter()
```

### getEllipsize

```
public TruncateAt getEllipsize()
```

### getFontVariationSettings

```
public String getFontVariationSettings()
```

### getHideMotionSpec

```
public MotionSpec getHideMotionSpec()
```

Returns this chip's hide motion spec.

ref com.google.android.material.R.styleable#Chip_hideMotionSpec

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setHideMotionSpec(com.google.android.material.animation.MotionSpec)` |   |

### getIconEndPadding

```
public float getIconEndPadding()
```

Returns the end padding for this chip's icon.

ref com.google.android.material.R.styleable#Chip_iconEndPadding

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setIconEndPadding(float)` |   |

### getIconStartPadding

```
public float getIconStartPadding()
```

Returns the start padding for this chip's icon.

ref com.google.android.material.R.styleable#Chip_iconStartPadding

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setIconStartPadding(float)` |   |

### getIntrinsicHeight

```
public int getIntrinsicHeight()
```

Returns the height at which the chip would like to be laid out.

### getIntrinsicWidth

```
public int getIntrinsicWidth()
```

Returns the width at which the chip would like to be laid out.

### getMaxWidth

```
public int getMaxWidth()
```

Returns the maximum width of TextView in terms of pixels.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setMaxWidth(int)` |   |

### getOpacity

```
public int getOpacity()
```

### getOutline

```
public void getOutline(Outline outline)
```

### getRippleColor

```
public ColorStateList getRippleColor()
```

Returns this chip's ripple color.

ref com.google.android.material.R.styleable#Chip_rippleColor

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setRippleColor(ColorStateList)` |   |

### getShowMotionSpec

```
public MotionSpec getShowMotionSpec()
```

Returns this chip's show motion spec.

ref com.google.android.material.R.styleable#Chip_showMotionSpec

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setShowMotionSpec(com.google.android.material.animation.MotionSpec)` |   |

### getText

```
public CharSequence getText()
```

### getTextAppearance

```
public TextAppearance getTextAppearance()
```

### getTextEndPadding

```
public float getTextEndPadding()
```

Returns the end padding for this chip's text.

ref com.google.android.material.R.styleable#Chip_textEndPadding

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setTextEndPadding(float)` |   |

### getTextStartPadding

```
public float getTextStartPadding()
```

Returns the start padding for this chip's text.

ref com.google.android.material.R.styleable#Chip_textStartPadding

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setTextStartPadding(float)` |   |

### getUseCompatRipple

```
public boolean getUseCompatRipple()
```

Returns whether this ChipDrawable should draw its own compatibility ripples.

### invalidateDrawable

```
public void invalidateDrawable(Drawable who)
```

### isCheckable

```
public boolean isCheckable()
```

### isCheckedIconEnabled

```
public boolean [isCheckedIconEnabled](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isCheckedIconEnabled())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isCheckedIconVisible()` instead.

### isCheckedIconVisible

```
public boolean isCheckedIconVisible()
```

### isChipIconEnabled

```
public boolean [isChipIconEnabled](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isChipIconEnabled())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isChipIconVisible()` instead.

### isChipIconVisible

```
public boolean isChipIconVisible()
```

### isCloseIconEnabled

```
public boolean [isCloseIconEnabled](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isCloseIconEnabled())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#isCloseIconVisible()` instead.

### isCloseIconStateful

```
public boolean isCloseIconStateful()
```

Indicates whether the close icon drawable will change its appearance based on state.

### isCloseIconVisible

```
public boolean isCloseIconVisible()
```

### isStateful

```
public boolean isStateful()
```

Indicates whether this chip drawable will change its appearance based on state.

### onLayoutDirectionChanged

```
public boolean onLayoutDirectionChanged(int layoutDirection)
```

### onStateChange

```
public boolean onStateChange(int[] state)
```

### onTextSizeChange

```
public void onTextSizeChange()
```

Handles a change in the text's size.

### scheduleDrawable

```
public void scheduleDrawable(Drawable who, Runnable what, long when)
```

### setAlpha

```
public void setAlpha(int alpha)
```

Sets the alpha of this ChipDrawable. This will drastically decrease draw performance. You are highly encouraged to use setAlpha instead.

### setCheckable

```
public void setCheckable(boolean checkable)
```

### setCheckableResource

```
public void setCheckableResource(int id)
```

### setCheckedIcon

```
public void setCheckedIcon(Drawable checkedIcon)
```

Sets this chip's checked icon.

ref com.google.android.material.R.styleable#Chip_checkedIcon

| Parameters |
|---|---|
| `Drawable checkedIcon` | This chip's checked icon. |

### setCheckedIconEnabled

```
public void [setCheckedIconEnabled](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckedIconEnabled(boolean))(boolean checkedIconEnabled)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckedIconVisible(boolean)` instead.

### setCheckedIconEnabledResource

```
public void [setCheckedIconEnabledResource](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckedIconEnabledResource(int))(int id)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCheckedIconVisible(int)` instead.

### setCheckedIconResource

```
public void setCheckedIconResource(int id)
```

Sets this chip's checked icon using a resource id.

ref com.google.android.material.R.styleable#Chip_checkedIcon

| Parameters |
|---|---|
| `int id` | The resource id of this chip's checked icon. |

### setCheckedIconTint

```
public void setCheckedIconTint(ColorStateList checkedIconTint)
```

Sets the checked icon's color tint using the specified android.content.res.ColorStateList.

ref com.google.android.material.R.styleable#Chip_checkedIconTint

| Parameters |
|---|---|
| `ColorStateList checkedIconTint` | ColorStateList to tint the checked icon. |

### setCheckedIconTintResource

```
public void setCheckedIconTintResource(int id)
```

Sets the checked icon's color tint using a resource ID.

ref com.google.android.material.R.styleable#Chip_checkedIconTint

| Parameters |
|---|---|
| `int id` | Resource id of a android.content.res.ColorStateList to tint the checked icon. |

### setCheckedIconVisible

```
public void setCheckedIconVisible(boolean checkedIconVisible)
```

### setCheckedIconVisible

```
public void setCheckedIconVisible(int id)
```

### setChipBackgroundColor

```
public void setChipBackgroundColor(ColorStateList chipBackgroundColor)
```

Sets this chip's background color.

ref com.google.android.material.R.styleable#Chip_chipBackgroundColor

| Parameters |
|---|---|
| `ColorStateList chipBackgroundColor` | This chip's background color. |

### setChipBackgroundColorResource

```
public void setChipBackgroundColorResource(int id)
```

Sets this chip's background color using a resource id.

ref com.google.android.material.R.styleable#Chip_chipBackgroundColor

| Parameters |
|---|---|
| `int id` | The resource id of this chip's background color. |

### setChipCornerRadius

```
public void [setChipCornerRadius](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipCornerRadius(float))(float chipCornerRadius)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> call `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel#withCornerSize(float)` or call `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel#toBuilder()` on the `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getShapeAppearanceModel()`, modify the shape using the builder and then call `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setShapeAppearanceModel(com.google.android.material.shape.ShapeAppearanceModel)`.

### setChipCornerRadiusResource

```
public void [setChipCornerRadiusResource](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipCornerRadiusResource(int))(int id)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> call `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel#withCornerSize(float)` or call `https://developer.android.com/reference/com/google/android/material/shape/ShapeAppearanceModel#toBuilder()` on the `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#getShapeAppearanceModel()`, modify the shape using the builder and then call `https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable#setShapeAppearanceModel(com.google.android.material.shape.ShapeAppearanceModel)`.

### setChipEndPadding

```
public void setChipEndPadding(float chipEndPadding)
```

Sets this chip's end padding.

ref com.google.android.material.R.styleable#Chip_chipEndPadding

| Parameters |
|---|---|
| `float chipEndPadding` | This chip's end padding. |

### setChipEndPaddingResource

```
public void setChipEndPaddingResource(int id)
```

Sets this chip's end padding using a resource id.

ref com.google.android.material.R.styleable#Chip_chipEndPadding

| Parameters |
|---|---|
| `int id` | The resource id for this chip's end padding. |

### setChipIcon

```
public void setChipIcon(Drawable chipIcon)
```

### setChipIconEnabled

```
public void [setChipIconEnabled](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconEnabled(boolean))(boolean chipIconEnabled)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconVisible(boolean)` instead.

### setChipIconEnabledResource

```
public void [setChipIconEnabledResource](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconEnabledResource(int))(int id)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setChipIconVisible(int)` instead.

### setChipIconResource

```
public void setChipIconResource(int id)
```

### setChipIconSize

```
public void setChipIconSize(float chipIconSize)
```

Sets this chip icon's size. If the value is zero or negative, the icon drawable's width and height (up to 24dp) will be used instead.

ref com.google.android.material.R.styleable#Chip_chipIconSize

| Parameters |
|---|---|
| `float chipIconSize` | This chip's icon size. |

### setChipIconSizeResource

```
public void setChipIconSizeResource(int id)
```

Sets this chip icon's size using a resource id. If the value is zero (@null) or negative, the icon drawable's width and height (up to 24dp) will be used instead.

ref com.google.android.material.R.styleable#Chip_chipIconSize

| Parameters |
|---|---|
| `int id` | The resource id of this chip's icon size. |

### setChipIconTint

```
public void setChipIconTint(ColorStateList chipIconTint)
```

Sets the chip icon's color tint using the specified android.content.res.ColorStateList.

ref com.google.android.material.R.styleable#Chip_chipIconTint

| Parameters |
|---|---|
| `ColorStateList chipIconTint` | ColorStateList to tint the chip icon. |

### setChipIconTintResource

```
public void setChipIconTintResource(int id)
```

Sets the chip icon's color tint using a resource ID.

ref com.google.android.material.R.styleable#Chip_chipIconTint

| Parameters |
|---|---|
| `int id` | Resource id of a android.content.res.ColorStateList to tint the chip icon. |

### setChipIconVisible

```
public void setChipIconVisible(boolean chipIconVisible)
```

### setChipIconVisible

```
public void setChipIconVisible(int id)
```

### setChipMinHeight

```
public void setChipMinHeight(float chipMinHeight)
```

Sets this chip's minimum height.

ref com.google.android.material.R.styleable#Chip_chipMinHeight

| Parameters |
|---|---|
| `float chipMinHeight` | This chip's minimum height. |

### setChipMinHeightResource

```
public void setChipMinHeightResource(int id)
```

Sets this chip's minimum height using a resource id.

ref com.google.android.material.R.styleable#Chip_chipMinHeight

| Parameters |
|---|---|
| `int id` | The resource id of this chip's minimum height. |

### setChipStartPadding

```
public void setChipStartPadding(float chipStartPadding)
```

Sets this chip's start padding.

ref com.google.android.material.R.styleable#Chip_chipStartPadding

| Parameters |
|---|---|
| `float chipStartPadding` | This chip's start padding. |

### setChipStartPaddingResource

```
public void setChipStartPaddingResource(int id)
```

Sets this chip's start padding using a resource id.

ref com.google.android.material.R.styleable#Chip_chipStartPadding

| Parameters |
|---|---|
| `int id` | The resource id of this chip's start padding. |

### setChipStrokeColor

```
public void setChipStrokeColor(ColorStateList chipStrokeColor)
```

Sets this chip's stroke color.

ref com.google.android.material.R.styleable#Chip_chipStrokeColor

| Parameters |
|---|---|
| `ColorStateList chipStrokeColor` | This chip's stroke color. |

### setChipStrokeColorResource

```
public void setChipStrokeColorResource(int id)
```

Sets this chip's stroke color using a resource id.

ref com.google.android.material.R.styleable#Chip_chipStrokeColor

| Parameters |
|---|---|
| `int id` | The resource id of this chip's stroke color. |

### setChipStrokeWidth

```
public void setChipStrokeWidth(float chipStrokeWidth)
```

Sets this chip's stroke width.

ref com.google.android.material.R.styleable#Chip_chipStrokeWidth

| Parameters |
|---|---|
| `float chipStrokeWidth` | This chip's stroke width. |

### setChipStrokeWidthResource

```
public void setChipStrokeWidthResource(int id)
```

Sets this chip's stroke width using a resource id.

ref com.google.android.material.R.styleable#Chip_chipStrokeWidth

| Parameters |
|---|---|
| `int id` | The resource id of this chip's stroke width. |

### setCloseIcon

```
public void setCloseIcon(Drawable closeIcon)
```

### setCloseIconContentDescription

```
public void setCloseIconContentDescription(
    CharSequence closeIconContentDescription
)
```

### setCloseIconEnabled

```
public void [setCloseIconEnabled](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconEnabled(boolean))(boolean closeIconEnabled)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconVisible(int)` instead.

### setCloseIconEnabledResource

```
public void [setCloseIconEnabledResource](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconEnabledResource(int))(int id)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable#setCloseIconVisible(int)` instead.

### setCloseIconEndPadding

```
public void setCloseIconEndPadding(float closeIconEndPadding)
```

Sets the end padding for this chip's close icon.

ref com.google.android.material.R.styleable#Chip_closeIconEndPadding

| Parameters |
|---|---|
| `float closeIconEndPadding` | The end padding of this chip's close icon. |

### setCloseIconEndPaddingResource

```
public void setCloseIconEndPaddingResource(int id)
```

Sets the end padding for this chip's close icon using a resource id.

ref com.google.android.material.R.styleable#Chip_closeIconEndPadding

| Parameters |
|---|---|
| `int id` | The resource id for the end padding of this chip's close icon. |

### setCloseIconResource

```
public void setCloseIconResource(int id)
```

### setCloseIconSize

```
public void setCloseIconSize(float closeIconSize)
```

### setCloseIconSizeResource

```
public void setCloseIconSizeResource(int id)
```

### setCloseIconStartPadding

```
public void setCloseIconStartPadding(float closeIconStartPadding)
```

Sets the start padding for this chip's close icon.

ref com.google.android.material.R.styleable#Chip_closeIconStartPadding

| Parameters |
|---|---|
| `float closeIconStartPadding` | The start padding of this chip's close icon. |

### setCloseIconStartPaddingResource

```
public void setCloseIconStartPaddingResource(int id)
```

Sets the start padding for this chip's close icon using a resource id.

ref com.google.android.material.R.styleable#Chip_closeIconStartPadding

| Parameters |
|---|---|
| `int id` | The resource id for the start padding of this chip's close icon. |

### setCloseIconState

```
public boolean setCloseIconState(int[] stateSet)
```

Specify a set of states for the close icon. This is a separate state set than the one used for the rest of the chip.

### setCloseIconTint

```
public void setCloseIconTint(ColorStateList closeIconTint)
```

### setCloseIconTintResource

```
public void setCloseIconTintResource(int id)
```

### setCloseIconVisible

```
public void setCloseIconVisible(boolean closeIconVisible)
```

### setCloseIconVisible

```
public void setCloseIconVisible(int id)
```

### setColorFilter

```
public void setColorFilter(ColorFilter colorFilter)
```

### setDelegate

```
public void setDelegate(ChipDrawable.Delegate delegate)
```

Sets the View delegate that owns this ChipDrawable.

### setEllipsize

```
public void setEllipsize(TruncateAt truncateAt)
```

### setFontVariationSettings

```
public void setFontVariationSettings(String fontVariationSettings)
```

### setHideMotionSpec

```
public void setHideMotionSpec(MotionSpec hideMotionSpec)
```

Sets this chip's hide motion spec.

ref com.google.android.material.R.styleable#Chip_hideMotionSpec

| Parameters |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/animation/MotionSpec hideMotionSpec` | This chip's hide motion spec. |

### setHideMotionSpecResource

```
public void setHideMotionSpecResource(int id)
```

Sets this chip's hide motion spec using a resource id.

ref com.google.android.material.R.styleable#Chip_hideMotionSpec

| Parameters |
|---|---|
| `int id` | The resource id of this chip's hide motion spec. |

### setIconEndPadding

```
public void setIconEndPadding(float iconEndPadding)
```

Sets the end padding for this chip's icon.

ref com.google.android.material.R.styleable#Chip_iconEndPadding

| Parameters |
|---|---|
| `float iconEndPadding` | The end padding of this chip's icon. |

### setIconEndPaddingResource

```
public void setIconEndPaddingResource(int id)
```

Sets the end padding for this chip's icon using a resource id.

ref com.google.android.material.R.styleable#Chip_iconEndPadding

| Parameters |
|---|---|
| `int id` | The resource id for the end padding of this chip's icon. |

### setIconStartPadding

```
public void setIconStartPadding(float iconStartPadding)
```

Sets this chip's icon start padding.

ref com.google.android.material.R.styleable#Chip_iconStartPadding

| Parameters |
|---|---|
| `float iconStartPadding` | The start padding of this chip's icon. |

### setIconStartPaddingResource

```
public void setIconStartPaddingResource(int id)
```

Sets the start padding for this chip's icon using a resource id.

ref com.google.android.material.R.styleable#Chip_iconStartPadding

| Parameters |
|---|---|
| `int id` | The resource id for the start padding of this chip's icon. |

### setMaxWidth

```
public void setMaxWidth(int maxWidth)
```

Sets the width of the TextView to be exactly `pixels` wide.

| Parameters |
|---|---|
| `int maxWidth` | maximum width of the textview. |

### setRippleColor

```
public void setRippleColor(ColorStateList rippleColor)
```

Sets this chip's ripple color.

ref com.google.android.material.R.styleable#Chip_rippleColor

| Parameters |
|---|---|
| `ColorStateList rippleColor` | This chip's ripple color. |

### setRippleColorResource

```
public void setRippleColorResource(int id)
```

Sets this chip's ripple color using a resource id.

ref com.google.android.material.R.styleable#Chip_rippleColor

| Parameters |
|---|---|
| `int id` | The resource id of this chip's ripple color. |

### setShowMotionSpec

```
public void setShowMotionSpec(MotionSpec showMotionSpec)
```

Sets this chip's show motion spec.

ref com.google.android.material.R.styleable#Chip_showMotionSpec

| Parameters |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/animation/MotionSpec showMotionSpec` | This chip's show motion spec. |

### setShowMotionSpecResource

```
public void setShowMotionSpecResource(int id)
```

Sets this chip's show motion spec using a resource id.

ref com.google.android.material.R.styleable#Chip_showMotionSpec

| Parameters |
|---|---|
| `int id` | The resource id of this chip's show motion spec. |

### setText

```
public void setText(CharSequence text)
```

### setTextAppearance

```
public void setTextAppearance(TextAppearance textAppearance)
```

### setTextAppearanceResource

```
public void setTextAppearanceResource(int id)
```

### setTextColor

```
public void setTextColor(ColorStateList color)
```

### setTextColor

```
public void setTextColor(int color)
```

### setTextEndPadding

```
public void setTextEndPadding(float textEndPadding)
```

Sets the end padding for this chip's text.

ref com.google.android.material.R.styleable#Chip_textStartPadding

| Parameters |
|---|---|
| `float textEndPadding` | The end padding of this chip's text. |

### setTextEndPaddingResource

```
public void setTextEndPaddingResource(int id)
```

Sets the end padding for this chip's text using a resource id.

ref com.google.android.material.R.styleable#Chip_textEndPadding

| Parameters |
|---|---|
| `int id` | The resource id for the end padding of this chip's text. |

### setTextResource

```
public void setTextResource(int id)
```

### setTextSize

```
public void setTextSize(float size)
```

### setTextStartPadding

```
public void setTextStartPadding(float textStartPadding)
```

Sets the start padding for this chip's text.

ref com.google.android.material.R.styleable#Chip_textStartPadding

| Parameters |
|---|---|
| `float textStartPadding` | The start padding of this chip's text. |

### setTextStartPaddingResource

```
public void setTextStartPaddingResource(int id)
```

Sets the start padding for this chip's text using a resource id.

ref com.google.android.material.R.styleable#Chip_textStartPadding

| Parameters |
|---|---|
| `int id` | The resource id for the start padding of this chip's text. |

### setTintList

```
public void setTintList(ColorStateList tint)
```

### setTintMode

```
public void setTintMode(Mode tintMode)
```

### setUseCompatRipple

```
public void setUseCompatRipple(boolean useCompatRipple)
```

Sets whether this ChipDrawable should draw its own compatibility ripples.

### setVisible

```
public boolean setVisible(boolean visible, boolean restart)
```

### unscheduleDrawable

```
public void unscheduleDrawable(Drawable who, Runnable what)
```

## Protected methods

### onLevelChange

```
protected boolean onLevelChange(int level)
```

### onSizeChange

```
protected void onSizeChange()
```

Attempts to call `https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable.Delegate#onChipDrawableSizeChange()` on the delegate.