Skip to content

Commit 9e256b6

Browse files
manabu-nakamuraimhappi
authored andcommitted
[Docs] update Button.md
Resolves #4445 GIT_ORIGIN_REV_ID=2a3508c02425dbc5c680ced3c1ff96151e4a004b PiperOrigin-RevId: 706814110
1 parent 4ca7cc3 commit 9e256b6

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

docs/components/Button.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Element | Attribute | Related method(s)
147147
**Color** | `app:backgroundTint` | `setBackgroundColor`<br/>`setBackgroundTintList`<br/>`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))
148148
**Stroke color** | `app:strokeColor` | `setStrokeColor`<br/>`setStrokeColorResource`<br/>`getStrokeColor` | `null`
149149
**Stroke width** | `app:strokeWidth` | `setStrokeWidth`<br/>`setStrokeWidthResource`<br/>`getStrokeWidth` | `0dp`
150-
**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`<br/>`getShapeAppearanceModel` | `?attr/shapeAppearanceSmallComponent`
150+
**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`<br/>`getShapeAppearanceModel` | `ShapeAppearance.M3.Sys.Shape.Corner.Full`
151151
**Elevation** | `app:elevation` | `setElevation`<br/>`getElevation` | `1dp`
152152
**Ripple color** | `app:rippleColor` | `setRippleColor`<br/>`setRippleColorResource`<br/>`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))
153153

@@ -262,7 +262,7 @@ Element | Attribute | Related method(s)
262262
**Color** | `app:backgroundTint` | `setBackgroundColor`<br/>`setBackgroundTintList`<br/>`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))
263263
**Stroke color** | `app:strokeColor` | `setStrokeColor`<br/>`setStrokeColorResource`<br/>`getStrokeColor` | `null`
264264
**Stroke width** | `app:strokeWidth` | `setStrokeWidth`<br/>`setStrokeWidthResource`<br/>`getStrokeWidth` | `0dp`
265-
**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`<br/>`getShapeAppearanceModel` | `?attr/shapeAppearanceSmallComponent`
265+
**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`<br/>`getShapeAppearanceModel` | `ShapeAppearance.M3.Sys.Shape.Corner.Full`
266266
**Elevation** | `app:elevation` | `setElevation`<br/>`getElevation` | `2dp`
267267
**Ripple color** | `app:rippleColor` | `setRippleColor`<br/>`setRippleColorResource`<br/>`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))
268268

@@ -377,7 +377,7 @@ Element | Attribute | Related method(s)
377377
**Color** | `app:backgroundTint` | `setBackgroundColor`<br/>`setBackgroundTintList`<br/>`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))
378378
**Stroke color** | `app:strokeColor` | `setStrokeColor`<br/>`setStrokeColorResource`<br/>`getStrokeColor` | `null`
379379
**Stroke width** | `app:strokeWidth` | `setStrokeWidth`<br/>`setStrokeWidthResource`<br/>`getStrokeWidth` | `0dp`
380-
**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`<br/>`getShapeAppearanceModel` | `?attr/shapeAppearanceSmallComponent`
380+
**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`<br/>`getShapeAppearanceModel` | `ShapeAppearance.M3.Sys.Shape.Corner.Full`
381381
**Elevation** | `app:elevation` | `setElevation`<br/>`getElevation` | `2dp`
382382
**Ripple color** | `app:rippleColor` | `setRippleColor`<br/>`setRippleColorResource`<br/>`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))
383383

@@ -488,7 +488,7 @@ Element | Attribute | Related method(s)
488488
**Color** | `app:backgroundTint` | `setBackgroundColor`<br/>`setBackgroundTintList`<br/>`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))
489489
**Stroke color** | `app:strokeColor` | `setStrokeColor`<br/>`setStrokeColorResource`<br/>`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))
490490
**Stroke width** | `app:strokeWidth` | `setStrokeWidth`<br/>`setStrokeWidthResource`<br/>`getStrokeWidth` | `1dp`
491-
**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`<br/>`getShapeAppearanceModel` | `?attr/shapeAppearanceSmallComponent`
491+
**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`<br/>`getShapeAppearanceModel` | `ShapeAppearance.M3.Sys.Shape.Corner.Full`
492492
**Elevation** | `app:elevation` | `setElevation`<br/>`getElevation` | `0dp`
493493
**Ripple color** | `app:rippleColor` | `setRippleColor`<br/>`setRippleColorResource`<br/>`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))
494494

@@ -595,7 +595,7 @@ Element | Attribute | Related method(s)
595595
**Color** | `app:backgroundTint` | `setBackgroundColor`<br/>`setBackgroundTintList`<br/>`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))
596596
**Stroke color** | `app:strokeColor` | `setStrokeColor`<br/>`setStrokeColorResource`<br/>`getStrokeColor` | `null`
597597
**Stroke width** | `app:strokeWidth` | `setStrokeWidth`<br/>`setStrokeWidthResource`<br/>`getStrokeWidth` | `0dp`
598-
**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`<br/>`getShapeAppearanceModel` | `?attr/shapeAppearanceSmallComponent`
598+
**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`<br/>`getShapeAppearanceModel` | `ShapeAppearance.M3.Sys.Shape.Corner.Full`
599599
**Elevation** | `app:elevation` | `setElevation`<br/>`getElevation` | `0dp`
600600
**Ripple color** | `app:rippleColor` | `setRippleColor`<br/>`setRippleColorResource`<br/>`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))
601601

@@ -1203,18 +1203,13 @@ all buttons. This affects other components:
12031203
<item name="colorPrimary">@color/shrine_pink_100</item>
12041204
<item name="colorOnPrimary">@color/shrine_pink_900</item>
12051205
<item name="textAppearanceLabelLarge">@style/TextAppearance.App.Button</item>
1206-
<item name="shapeAppearanceSmallComponent">@style/ShapeAppearance.App.SmallComponent</item>
1206+
<item name="shapeCornerFamily">cut</item>
12071207
</style>
12081208

12091209
<style name="TextAppearance.App.Button" parent="TextAppearance.Material3.LabelLarge">
12101210
<item name="fontFamily">@font/rubik</item>
12111211
<item name="android:fontFamily">@font/rubik</item>
12121212
</style>
1213-
1214-
<style name="ShapeAppearance.App.SmallComponent" parent="ShapeAppearance.Material3.SmallComponent">
1215-
<item name="cornerFamily">cut</item>
1216-
<item name="cornerSize">4dp</item>
1217-
</style>
12181213
```
12191214

12201215
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:
12311226
<style name="Widget.App.Button.TextButton" parent="Widget.Material3.Button.TextButton">
12321227
<item name="materialThemeOverlay">@style/ThemeOverlay.App.Button.TextButton</item>
12331228
<item name="android:textAppearance">@style/TextAppearance.App.Button</item>
1234-
<item name="shapeAppearance">@style/ShapeAppearance.App.SmallComponent</item>
1229+
<item name="shapeAppearance">@style/ShapeAppearance.App.Button</item>
12351230
</style>
12361231

12371232
<style name="Widget.App.Button.OutlinedButton" parent="Widget.Material3.Button.OutlinedButton">
12381233
<item name="materialThemeOverlay">@style/ThemeOverlay.App.Button.TextButton</item>
12391234
<item name="android:textAppearance">@style/TextAppearance.App.Button</item>
1240-
<item name="shapeAppearance">@style/ShapeAppearance.App.SmallComponent</item>
1235+
<item name="shapeAppearance">@style/ShapeAppearance.App.Button</item>
12411236
</style>
12421237

12431238
<style name="Widget.App.Button" parent="Widget.Material3.Button">
12441239
<item name="materialThemeOverlay">@style/ThemeOverlay.App.Button</item>
12451240
<item name="android:textAppearance">@style/TextAppearance.App.Button</item>
1246-
<item name="shapeAppearance">@style/ShapeAppearance.App.SmallComponent</item>
1241+
<item name="shapeAppearance">@style/ShapeAppearance.App.Button</item>
12471242
</style>
12481243

12491244
<style name="ThemeOverlay.App.Button.TextButton" parent="ThemeOverlay.Material3.Button.TextButton">
@@ -1254,6 +1249,11 @@ theme to all buttons but does not affect other components:
12541249
<item name="colorContainer">@color/shrine_pink_100</item>
12551250
<item name="colorOnContainer">@color/shrine_pink_900</item>
12561251
</style>
1252+
1253+
<style name="ShapeAppearance.App.Button" parent="">
1254+
<item name="cornerFamily">cut</item>
1255+
<item name="cornerSize">4dp</item>
1256+
</style>
12571257
```
12581258

12591259
Use one of the styles in the layout. That will affect only this button:

0 commit comments

Comments
 (0)