Skip to content

Commit

Permalink
[RadioButton] Refactored button tint color resource and updated docs
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 453664804
  • Loading branch information
leticiarossi authored and pekingme committed Jun 9, 2022
1 parent a601107 commit 254abc5
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/components/Checkbox.md
Expand Up @@ -150,7 +150,7 @@ checkbox.setOnCheckedChangeListener { buttonView, isChecked ->
Element | Attribute | Related method(s) | Default value
-------------------------- | ------------------------------------------ | ---------------------------------------------------------- | -------------
**To use material colors** | `app:useMaterialThemeColors` | `setUseMaterialThemeColors`<br/>`isUseMaterialThemeColors` | `true` (ignored if `app:buttonTint` is set)
**Color** | `app:buttonTint` | `setButtonTintList`<br/>`getButtonTintList` | `?attr/colorOnSurface` (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/color/res/color/m3_selection_control_button_tint.xml))
**Color** | `app:buttonTint` | `setButtonTintList`<br/>`getButtonTintList` | `?attr/colorOnSurface` (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/checkbox/res/color/m3_checkbox_button_tint.xml))
**Min size** | `android:minWidth`<br/>`android:minHeight` | `(set/get)MinWidth`<br/>`(set/get)MinHeight` | `?attr/minTouchTargetSize`
**Centered icon if no text** | `app:centerIfNoTextEnabled` | `setCenterIfNoTextEnabled`<br/>`isCenterIfNoTextEnabled` | `true`

Expand Down
2 changes: 1 addition & 1 deletion docs/components/RadioButton.md
Expand Up @@ -135,7 +135,7 @@ radioButton.setOnCheckedChangeListener { buttonView, isChecked
Element | Attribute | Related method(s) | Default value
-------------------------- | ------------------------------------------ | ---------------------------------------------------------- | -------------
**To use material colors** | `app:useMaterialThemeColors` | `setUseMaterialThemeColors`<br/>`isUseMaterialThemeColors` | `true` (ignored if `app:buttonTint` is set)
**Color** | `app:buttonTint` | `setButtonTintList`<br/>`getButtonTintList` | `?attr/colorOnSurface` (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/color/res/color/m3_selection_control_button_tint.xml))
**Color** | `app:buttonTint` | `setButtonTintList`<br/>`getButtonTintList` | `?attr/colorOnSurface` (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/radiobutton/res/color/m3_radiobutton_button_tint.xml))
**Min size** | `android:minWidth`<br/>`android:minHeight` | `(set/get)MinWidth`<br/>`(set/get)MinHeight` | `?attr/minTouchTargetSize`

The color of the radio button defaults to `?attr/colorOnSurface` (unchecked) and
Expand Down
Expand Up @@ -26,7 +26,7 @@
<style name="Base.Widget.Material3.CompoundButton.RadioButton" parent="Widget.MaterialComponents.CompoundButton.RadioButton">
<!-- Inherit default text color since the component doesn't draw a surface. -->
<item name="android:textAppearance">?attr/textAppearanceBodyMedium</item>
<item name="buttonTint">@color/m3_selection_control_button_tint</item>
<item name="buttonTint">@color/m3_radiobutton_button_tint</item>
</style>

<style name="Widget.Material3.CompoundButton.RadioButton" parent="Base.Widget.Material3.CompoundButton.RadioButton"/>
Expand Down

0 comments on commit 254abc5

Please sign in to comment.