@@ -418,85 +418,85 @@ The following is an anatomy diagram of a chip:
418418
419419#### Container attributes
420420
421- Element | Attribute | Related method(s) | Default value
422- -------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -------------
423- ** Color** | ` app:chipBackgroundColor ` | ` setChipBackgroundColor ` <br />` setChipBackgroundColorResource ` <br />` getChipBackgroundColor ` | ` ?attr/colorOnSurface `
424- ** Ripple color** | ` app:rippleColor ` | ` setRippleColor ` <br />` setRippleColorResource ` <br />` getRippleColor ` | ` ?attr/colorOnSecondaryContainer ` at 12%
425- ** Stroke width** | ` app:chipStrokeWidth ` | ` setStrokeWidth ` <br />` setChipStrokeWidthResource ` <br />` getChipStrokeWidth ` | ` 1dp `
426- ** Stroke color** | ` app:chipStrokeColor ` | ` setStrokeColor ` <br />` setChipStrokeColorResource ` <br />` getChipStrokeColor ` | ` ?attr/colorOnSurface `
427- ** Min height** | ` app:chipMinHeight ` | ` setChipMinHeight ` <br />` setChipMinHeightResource ` <br />` getChipMinHeight ` | ` 32dp `
428- ** Padding** | ` app:chipStartPadding ` <br />` app:chipEndPadding ` | ` setChip*Padding ` <br />` setChip*PaddingResource ` <br />` getChip*Padding ` | ` 4dp ` (start)<br />` 6dp ` (end)
429- ** Shape** | ` app:shapeAppearance ` <br />` shapeAppearanceOverlay ` | ` setShapeAppearanceModel ` <br />` getShapeAppearanceModel ` | ` ?attr/shapeAppearanceSmallComponent ` with 8dp ` cornerSize `
430- ** Min touch target** | ` app:chipMinTouchTargetSize ` <br />` app:ensureMinTouchTargetSize ` | ` ensureAccessibleTouchTarget ` <br />` setEnsureAccessibleTouchTarget ` <br />` shouldEnsureAccessibleTouchTarget ` | ` 48dp ` <br />` true `
431- ** Checkable** | ` android:checkable ` | ` setCheckable ` <br />` setCheckableResource ` <br />` isCheckable ` | ` true ` (input, suggestion, filter)
421+ | Element | Attribute | Related method(s) | Default value |
422+ | ---------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------- |
423+ | ** Color** | ` app:chipBackgroundColor ` | ` setChipBackgroundColor ` <br />` setChipBackgroundColorResource ` <br />` getChipBackgroundColor ` | ` ?attr/colorOnSurface ` |
424+ | ** Ripple color** | ` app:rippleColor ` | ` setRippleColor ` <br />` setRippleColorResource ` <br />` getRippleColor ` | ` ?attr/colorOnSecondaryContainer ` at 12% |
425+ | ** Stroke width** | ` app:chipStrokeWidth ` | ` setStrokeWidth ` <br />` setChipStrokeWidthResource ` <br />` getChipStrokeWidth ` | ` 1dp ` |
426+ | ** Stroke color** | ` app:chipStrokeColor ` | ` setStrokeColor ` <br />` setChipStrokeColorResource ` <br />` getChipStrokeColor ` | ` ?attr/colorOnSurface ` |
427+ | ** Min height** | ` app:chipMinHeight ` | ` setChipMinHeight ` <br />` setChipMinHeightResource ` <br />` getChipMinHeight ` | ` 32dp ` |
428+ | ** Padding** | ` app:chipStartPadding ` <br />` app:chipEndPadding ` | ` setChip*Padding ` <br />` setChip*PaddingResource ` <br />` getChip*Padding ` | ` 4dp ` (start)<br />` 6dp ` (end) |
429+ | ** Shape** | ` app:shapeAppearance ` <br />` shapeAppearanceOverlay ` | ` setShapeAppearanceModel ` <br />` getShapeAppearanceModel ` | ` ?attr/shapeAppearanceSmallComponent ` with 8dp ` cornerSize ` |
430+ | ** Min touch target** | ` app:chipMinTouchTargetSize ` <br />` app:ensureMinTouchTargetSize ` | ` ensureAccessibleTouchTarget ` <br />` setEnsureAccessibleTouchTarget ` <br />` shouldEnsureAccessibleTouchTarget ` | ` 48dp ` <br />` true ` |
431+ | ** Checkable** | ` android:checkable ` | ` setCheckable ` <br />` setCheckableResource ` <br />` isCheckable ` | ` true ` (input, suggestion, filter) |
432432
433433#### Thumbnail attributes
434434
435435** Chip icon**
436436
437- Element | Attribute | Related method(s) | Default value
438- -------------- | ----------------------------------------------- | --------------------------------------------------------------------- | -------------
439- ** Icon** | ` app:chipIcon ` | ` setChipIconVisible ` <br />` isChipIconVisible ` | ` null `
440- ** Visibility** | ` app:chipIconVisible ` | ` setChipIcon ` <br />` setChipIconResource ` < br /> ` getChipIcon ` | ` true ` (input and assist)
441- ** Color** | ` app:chipIconTint ` | ` setChipIconTint ` <br />` setChipIconTintResource ` <br />` getChipIconTint ` | ` null `
442- ** Size** | ` app:chipIconSize ` | ` setChipIconSize ` <br />` setChipIconSizeResource ` <br />` getChipIconSize ` | ` 18dp `
443- ** Padding** | ` app:iconStartPadding ` <br />` app:iconEndPadding ` | ` setIcon*Padding ` <br />` setIcon*PaddingResource ` <br />` getIcon*Padding ` | ` 0dp ` , ` -2dp ` (filter end padding)
437+ | Element | Attribute | Related method(s) | Default value |
438+ | ---------------- | ------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------ |
439+ | ** Icon** | ` app:chipIcon ` | ` setChipIcon ` <br />` setChipIconResource ` < br /> ` getChipIcon ` | ` null ` |
440+ | ** Visibility** | ` app:chipIconVisible ` | ` setChipIconVisible ` <br />` isChipIconVisible ` | ` true ` (input and assist) |
441+ | ** Color** | ` app:chipIconTint ` | ` setChipIconTint ` <br />` setChipIconTintResource ` <br />` getChipIconTint ` | ` null ` |
442+ | ** Size** | ` app:chipIconSize ` | ` setChipIconSize ` <br />` setChipIconSizeResource ` <br />` getChipIconSize ` | ` 18dp ` |
443+ | ** Padding** | ` app:iconStartPadding ` <br />` app:iconEndPadding ` | ` setIcon*Padding ` <br />` setIcon*PaddingResource ` <br />` getIcon*Padding ` | ` 0dp ` , ` -2dp ` (filter end padding) |
444444
445445** Checked icon**
446446
447447If visible, the checked icon overlays the chip icon.
448448
449- Element | Attribute | Related method(s) | Default value
450- -------------- | ------------------------ | ------------------------------------------------------------------------------ | -------------
451- ** Icon** | ` app:checkedIcon ` | ` setCheckedIconVisible ` <br />` isCheckedIconVisible ` | ` @drawable/ic_m3_chip_checked_circle `
452- ** Visibility** | ` app:checkedIconVisible ` | ` setCheckedIcon ` <br />` setCheckedIconResource ` < br /> ` getCheckedIcon ` | ` true ` (input, filter)
453- ** Color** | ` app:checkedIconTint ` | ` setCheckedIconTint ` <br />` setCheckedIconTintResource ` <br />` getCheckedIconTint ` | ` null `
449+ | Element | Attribute | Related method(s) | Default value |
450+ | ---------------- | -------------------------- | -------------------------------------------------------------------------------- | --------------------------------------- |
451+ | ** Icon** | ` app:checkedIcon ` | ` setCheckedIcon ` <br />` setCheckedIconResource ` < br /> ` getCheckedIcon ` | ` @drawable/ic_m3_chip_checked_circle ` |
452+ | ** Visibility** | ` app:checkedIconVisible ` | ` setCheckedIconVisible ` <br />` isCheckedIconVisible ` | ` true ` (input, filter) |
453+ | ** Color** | ` app:checkedIconTint ` | ` setCheckedIconTint ` <br />` setCheckedIconTintResource ` <br />` getCheckedIconTint ` | ` null ` |
454454
455455#### Text attributes
456456
457- Element | Attribute | Related method(s) | Default value
458- -------------- | ----------------------------------------------- | --------------------------------------------------------------------------- | -------------
459- ** Text label** | ` android:text ` | ` setChipText ` <br />` setChipTextResource ` <br />` getChipText ` | ` null `
460- ** Color** | ` android:textColor ` | ` setTextColor ` <br />` getTextColors ` | ` ?attr/colorOnSurfaceVariant `
461- ** Typography** | ` android:textAppearance ` | ` setTextAppearance ` <br />` setTextAppearanceResource ` <br />` getTextAppearance ` | ` ?attr/textAppearanceLabelLarge `
462- ** Padding** | ` app:textStartPadding ` <br />` app:textEndPadding ` | ` setText*Padding ` <br />` setText*PaddingResource ` <br />` getText*Padding ` | ` 8dp ` (start)<br />` 6dp ` (end)
457+ | Element | Attribute | Related method(s) | Default value |
458+ | ---------------- | ------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------- |
459+ | ** Text label** | ` android:text ` | ` setChipText ` <br />` setChipTextResource ` <br />` getChipText ` | ` null ` |
460+ | ** Color** | ` android:textColor ` | ` setTextColor ` <br />` getTextColors ` | ` ?attr/colorOnSurfaceVariant ` |
461+ | ** Typography** | ` android:textAppearance ` | ` setTextAppearance ` <br />` setTextAppearanceResource ` <br />` getTextAppearance ` | ` ?attr/textAppearanceLabelLarge ` |
462+ | ** Padding** | ` app:textStartPadding ` <br />` app:textEndPadding ` | ` setText*Padding ` <br />` setText*PaddingResource ` <br />` getText*Padding ` | ` 8dp ` (start)<br />` 6dp ` (end) |
463463
464464#### Remove (close) icon attributes
465465
466- Element | Attribute | Related method(s) | Default value
467- ----------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------ | -------------
468- ** Icon** | ` app:closeIcon ` | ` setCloseIcon ` <br />` setCloseIconResource ` <br />` getCloseIcon ` | ` @drawable/ic_mtrl_chip_close_circle `
469- ** Visibility** | ` app:closeIconVisible ` | ` setCloseIconVisible ` <br />` isCloseIconVisible ` | ` true ` for input
470- ** Color** | ` app:closeIconTint ` | ` setCloseIconTint ` <br />` setCloseIconTintResource ` <br />` getCloseIconTint ` | ` ?attr/colorOnSurfaceVariant `
471- ** Size** | ` app:closeIconSize ` | ` setCloseIconSize ` <br />` setCloseIconSizeResource ` <br />` getCloseIconSize ` | ` 18dp `
472- ** Padding** | ` app:closeIconStartPadding ` <br />` app:closeIconEndPadding ` | ` setCloseIcon*Padding ` <br />` setCloseIcon*PaddingResource ` <br />` getCloseIcon*Padding ` | ` 4dp ` input end padding
473- ** Content description** | N/A | ` setCloseIconContentDescription ` <br />` getCloseIconContentDescription ` | ` @string/mtrl_chip_close_icon_content_description `
466+ | Element | Attribute | Related method(s) | Default value |
467+ | ------------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------- |
468+ | ** Icon** | ` app:closeIcon ` | ` setCloseIcon ` <br />` setCloseIconResource ` <br />` getCloseIcon ` | ` @drawable/ic_mtrl_chip_close_circle ` |
469+ | ** Visibility** | ` app:closeIconVisible ` | ` setCloseIconVisible ` <br />` isCloseIconVisible ` | ` true ` for input |
470+ | ** Color** | ` app:closeIconTint ` | ` setCloseIconTint ` <br />` setCloseIconTintResource ` <br />` getCloseIconTint ` | ` ?attr/colorOnSurfaceVariant ` |
471+ | ** Size** | ` app:closeIconSize ` | ` setCloseIconSize ` <br />` setCloseIconSizeResource ` <br />` getCloseIconSize ` | ` 18dp ` |
472+ | ** Padding** | ` app:closeIconStartPadding ` <br />` app:closeIconEndPadding ` | ` setCloseIcon*Padding ` <br />` setCloseIcon*PaddingResource ` <br />` getCloseIcon*Padding ` | ` 4dp ` input end padding |
473+ | ** Content description** | N/A | ` setCloseIconContentDescription ` <br />` getCloseIconContentDescription ` | ` @string/mtrl_chip_close_icon_content_description ` |
474474
475475#### ` ChipGroup ` attributes
476476
477- Element | Attribute | Related method(s) | Default value
478- ------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------- | -------------
479- ** Layout** | ` app:singleLine ` | ` setSingleLine ` <br />` isSingleLine ` | ` false `
480- ** Selection** | ` app:singleSelection ` <br />` app:selectionRequired ` | ` setSingleSelection* ` <br />` isSingleSelection* ` | ` false ` <br />` false `
481- ** Spacing** | ` app:chipSpacing ` <br />` app:chipSpacingHorizontal ` <br />` chipSpacingVertical ` | ` setSpacing* ` <br />` setChipSpacing*Resource ` <br />` getSpacing* ` | ` 8dp `
477+ | Element | Attribute | Related method(s) | Default value |
478+ | --------------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------- | --------------------- |
479+ | ** Layout** | ` app:singleLine ` | ` setSingleLine ` <br />` isSingleLine ` | ` false ` |
480+ | ** Selection** | ` app:singleSelection ` <br />` app:selectionRequired ` | ` setSingleSelection* ` <br />` isSingleSelection* ` | ` false ` <br />` false ` |
481+ | ** Spacing** | ` app:chipSpacing ` <br />` app:chipSpacingHorizontal ` <br />` chipSpacingVertical ` | ` setSpacing* ` <br />` setChipSpacing*Resource ` <br />` getSpacing* ` | ` 8dp ` |
482482
483483#### Styles
484484
485- Element | Style
486- ------------------------------- | ----------------------------------
487- ** Default style (assist chip)** | ` Widget.Material3.Chip.Assist `
488- ** Input chip** | ` Widget.Material3.Chip.Input `
489- ** Suggestion chip** | ` Widget.Material3.Chip.Suggestion `
490- ** Filter chip** | ` Widget.Material3.Chip.Filter `
491- ** ` ChipGroup ` style** | ` Widget.Material3.ChipGroup `
485+ | Element | Style |
486+ | --------------------------------- | ------------------------------------ |
487+ | ** Default style (assist chip)** | ` Widget.Material3.Chip.Assist ` |
488+ | ** Input chip** | ` Widget.Material3.Chip.Input ` |
489+ | ** Suggestion chip** | ` Widget.Material3.Chip.Suggestion ` |
490+ | ** Filter chip** | ` Widget.Material3.Chip.Filter ` |
491+ | ** ` ChipGroup ` style** | ` Widget.Material3.ChipGroup ` |
492492
493493#### Theme attributes
494494
495- Element | Theme attribute | Default style
496- ------------------ | --------------------------- | -------------
497- ** ` Chip ` ** | ` ?attr/chipStyle ` | ` Widget.Material3.Chip.Assist `
498- ** ` ChipGroup ` ** | ` ?attr/chipGroupStyle ` | ` Widget.Material3.ChipGroup `
499- ** ` ChipDrawable ` ** | ` ?attr/chipStandaloneStyle ` | ` Widget.Material3.Chip.Input `
495+ | Element | Theme attribute | Default style |
496+ | -------------------- | ----------------------------- | -------------------------------- |
497+ | ** ` Chip ` ** | ` ?attr/chipStyle ` | ` Widget.Material3.Chip.Assist ` |
498+ | ** ` ChipGroup ` ** | ` ?attr/chipGroupStyle ` | ` Widget.Material3.ChipGroup ` |
499+ | ** ` ChipDrawable ` ** | ` ?attr/chipStandaloneStyle ` | ` Widget.Material3.Chip.Input ` |
500500
501501See the full list of
502502[ styles] ( https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/chip/res/values/styles.xml )
0 commit comments