From 2a3508c02425dbc5c680ced3c1ff96151e4a004b Mon Sep 17 00:00:00 2001 From: manabu-nakamura Date: Sun, 1 Dec 2024 01:51:10 +0900 Subject: [PATCH] [Docs] update Button.md --- docs/components/Button.md | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/docs/components/Button.md b/docs/components/Button.md index abd4ca20717..f2406ce9033 100644 --- a/docs/components/Button.md +++ b/docs/components/Button.md @@ -147,7 +147,7 @@ Element | Attribute | Related method(s) **Color** | `app:backgroundTint` | `setBackgroundColor`
`setBackgroundTintList`
`getBackgroundTintList` | `?attr/colorSurfaceContainerLow` (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/button/res/color/m3_text_button_background_color_selector.xml)) **Stroke color** | `app:strokeColor` | `setStrokeColor`
`setStrokeColorResource`
`getStrokeColor` | `null` **Stroke width** | `app:strokeWidth` | `setStrokeWidth`
`setStrokeWidthResource`
`getStrokeWidth` | `0dp` -**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`
`getShapeAppearanceModel` | `?attr/shapeAppearanceSmallComponent` +**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`
`getShapeAppearanceModel` | `ShapeAppearance.M3.Comp.FilledButton.Container.Shape` **Elevation** | `app:elevation` | `setElevation`
`getElevation` | `1dp` **Ripple color** | `app:rippleColor` | `setRippleColor`
`setRippleColorResource`
`getRippleColor` | `?attr/colorOnSurface` at 16% opacity (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/button/res/color/m3_text_button_ripple_color_selector.xml)) @@ -262,7 +262,7 @@ Element | Attribute | Related method(s) **Color** | `app:backgroundTint` | `setBackgroundColor`
`setBackgroundTintList`
`getBackgroundTintList` | `?attr/colorPrimary` (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/color/res/color/m3_button_background_color_selector.xml)) **Stroke color** | `app:strokeColor` | `setStrokeColor`
`setStrokeColorResource`
`getStrokeColor` | `null` **Stroke width** | `app:strokeWidth` | `setStrokeWidth`
`setStrokeWidthResource`
`getStrokeWidth` | `0dp` -**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`
`getShapeAppearanceModel` | `?attr/shapeAppearanceSmallComponent` +**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`
`getShapeAppearanceModel` | `ShapeAppearance.M3.Comp.FilledButton.Container.Shape` **Elevation** | `app:elevation` | `setElevation`
`getElevation` | `2dp` **Ripple color** | `app:rippleColor` | `setRippleColor`
`setRippleColorResource`
`getRippleColor` | `?attr/colorOnPrimary` at 16% opacity (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/color/res/color/m3_button_ripple_color_selector.xml)) @@ -377,7 +377,7 @@ Element | Attribute | Related method(s) **Color** | `app:backgroundTint` | `setBackgroundColor`
`setBackgroundTintList`
`getBackgroundTintList` | `?attr/colorSecondaryContainer` (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/color/res/color/m3_button_background_color_selector.xml)) **Stroke color** | `app:strokeColor` | `setStrokeColor`
`setStrokeColorResource`
`getStrokeColor` | `null` **Stroke width** | `app:strokeWidth` | `setStrokeWidth`
`setStrokeWidthResource`
`getStrokeWidth` | `0dp` -**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`
`getShapeAppearanceModel` | `?attr/shapeAppearanceSmallComponent` +**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`
`getShapeAppearanceModel` | `ShapeAppearance.M3.Comp.FilledButton.Container.Shape` **Elevation** | `app:elevation` | `setElevation`
`getElevation` | `2dp` **Ripple color** | `app:rippleColor` | `setRippleColor`
`setRippleColorResource`
`getRippleColor` | `?attr/colorOnSecondaryContainer` at 16% opacity (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/color/res/color/m3_tonal_button_ripple_color_selector.xml)) @@ -488,7 +488,7 @@ Element | Attribute | Related method(s) **Color** | `app:backgroundTint` | `setBackgroundColor`
`setBackgroundTintList`
`getBackgroundTintList` | `@android:color/transparent` (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/button/res/color/m3_text_button_background_color_selector.xml)) **Stroke color** | `app:strokeColor` | `setStrokeColor`
`setStrokeColorResource`
`getStrokeColor` | `?attr/colorOnSurface` at 12% opacity (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/button/res/color/m3_button_outline_color_selector.xml)) **Stroke width** | `app:strokeWidth` | `setStrokeWidth`
`setStrokeWidthResource`
`getStrokeWidth` | `1dp` -**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`
`getShapeAppearanceModel` | `?attr/shapeAppearanceSmallComponent` +**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`
`getShapeAppearanceModel` | `ShapeAppearance.M3.Comp.TextButton.Container.Shape` **Elevation** | `app:elevation` | `setElevation`
`getElevation` | `0dp` **Ripple color** | `app:rippleColor` | `setRippleColor`
`setRippleColorResource`
`getRippleColor` | `?attr/colorOnSurface` at 16% opacity (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/button/res/color/m3_text_button_ripple_color_selector.xml)) @@ -595,7 +595,7 @@ Element | Attribute | Related method(s) **Color** | `app:backgroundTint` | `setBackgroundColor`
`setBackgroundTintList`
`getBackgroundTintList` | `@android:color/transparent` (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/button/res/color/m3_text_button_background_color_selector.xml)) **Stroke color** | `app:strokeColor` | `setStrokeColor`
`setStrokeColorResource`
`getStrokeColor` | `null` **Stroke width** | `app:strokeWidth` | `setStrokeWidth`
`setStrokeWidthResource`
`getStrokeWidth` | `0dp` -**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`
`getShapeAppearanceModel` | `?attr/shapeAppearanceSmallComponent` +**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`
`getShapeAppearanceModel` | `ShapeAppearance.M3.Comp.TextButton.Container.Shape` **Elevation** | `app:elevation` | `setElevation`
`getElevation` | `0dp` **Ripple color** | `app:rippleColor` | `setRippleColor`
`setRippleColorResource`
`getRippleColor` | `?attr/colorOnSurface` at 16% opacity (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/button/res/color/m3_text_button_ripple_color_selector.xml)) @@ -1203,18 +1203,13 @@ all buttons. This affects other components: @color/shrine_pink_100 @color/shrine_pink_900 @style/TextAppearance.App.Button - @style/ShapeAppearance.App.SmallComponent + cut - - ``` Use default style theme attributes, styles and theme overlays. This adds the @@ -1231,19 +1226,19 @@ theme to all buttons but does not affect other components: + + + + ``` Use one of the styles in the layout. That will affect only this button: