Skip to content

Commit 07d2584

Browse files
imhappidsn5ft
authored andcommitted
[Docs][RadioButton] Update docs to use M3 screenshots
Resolves #4282 PiperOrigin-RevId: 672724449
1 parent 9285220 commit 07d2584

File tree

5 files changed

+22
-23
lines changed

5 files changed

+22
-23
lines changed

catalog/java/io/material/catalog/radiobutton/res/layout/cat_radiobutton.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,21 @@
3838
android:layout_width="match_parent"
3939
android:layout_height="match_parent"
4040
android:enabled="true"
41+
android:paddingStart="@dimen/cat_radiobutton_indent"
4142
android:text="@string/cat_radiobutton_enabled"/>
4243
<RadioButton
4344
android:layout_width="match_parent"
4445
android:layout_height="match_parent"
4546
android:checked="false"
4647
android:enabled="true"
48+
android:paddingStart="@dimen/cat_radiobutton_indent"
4749
android:text="@string/cat_radiobutton_enabled"/>
4850
<RadioButton
4951
android:layout_width="match_parent"
5052
android:layout_height="match_parent"
5153
android:checked="false"
5254
android:enabled="true"
55+
android:paddingStart="@dimen/cat_radiobutton_indent"
5356
android:text="@string/cat_radiobutton_enabled"/>
5457
</RadioGroup>
5558
<TextView
@@ -67,17 +70,20 @@
6770
android:layout_width="wrap_content"
6871
android:layout_height="wrap_content"
6972
android:enabled="false"
73+
android:paddingHorizontal="@dimen/cat_radiobutton_indent"
7074
android:text="@string/cat_radiobutton_disabled"/>
7175
<RadioButton
7276
android:layout_width="wrap_content"
7377
android:layout_height="wrap_content"
7478
android:checked="false"
7579
android:enabled="false"
80+
android:paddingHorizontal="@dimen/cat_radiobutton_indent"
7681
android:text="@string/cat_radiobutton_disabled"/>
7782
<RadioButton
7883
android:layout_width="wrap_content"
7984
android:layout_height="wrap_content"
8085
android:checked="false"
86+
android:paddingHorizontal="@dimen/cat_radiobutton_indent"
8187
android:text="@string/cat_radiobutton_enabled" />
8288
</RadioGroup>
8389
</LinearLayout>

docs/components/RadioButton.md

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Use radio buttons to:
1919
* If available options can be collapsed, consider using a dropdown menu
2020
instead, as it uses less space.
2121

22-
![Settings menu with radio buttons for ringtones](assets/radiobutton/radiobutton_hero.png)
22+
![Settings menu with radio buttons](assets/radiobutton/radiobutton.png)
2323

2424
**Contents**
2525

@@ -75,45 +75,38 @@ API and source code:
7575

7676
### Radio buttons example
7777

78-
The following example shows a radio button group with five radio buttons.
78+
The following example shows a radio button group with three radio buttons.
7979

80-
![Example radio button group with 5 radio buttons, the first one is selected and
81-
the last one is disabled.](assets/radiobutton/radiobutton_example.png)
80+
![Example radio button group with 3 radio buttons, the first one is selected](assets/radiobutton/radiobutton_example.png)
8281

8382
In the layout:
8483

8584
```xml
8685
<RadioGroup
87-
android:id="@+id/radioGroup"
88-
android:checkedButton="@+id/radio_button_1"
86+
android:checkedButton="@+id/enabled_selected"
8987
android:layout_width="match_parent"
9088
android:layout_height="wrap_content">
9189
<RadioButton
92-
android:id="@+id/radio_button_1"
90+
android:id="@+id/enabled_selected"
9391
android:layout_width="match_parent"
9492
android:layout_height="match_parent"
95-
android:text="@string/label_1"/>
93+
android:enabled="true"
94+
android:paddingStart="@dimen/padding_start"
95+
android:text="@string/radiobutton_text"/>
9696
<RadioButton
97-
android:id="@+id/radio_button_2"
9897
android:layout_width="match_parent"
9998
android:layout_height="match_parent"
100-
android:text="@string/label_2"/>
99+
android:checked="false"
100+
android:enabled="true"
101+
android:paddingStart="@dimen/padding_start"
102+
android:text="@string/radiobutton_text"/>
101103
<RadioButton
102-
android:id="@+id/radio_button_3"
103104
android:layout_width="match_parent"
104105
android:layout_height="match_parent"
105-
android:text="@string/label_3"/>
106-
<RadioButton
107-
android:id="@+id/radio_button_4"
108-
android:layout_width="match_parent"
109-
android:layout_height="match_parent"
110-
android:text="@string/label_4"/>
111-
<RadioButton
112-
android:id="@+id/radio_button_5"
113-
android:layout_width="match_parent"
114-
android:layout_height="match_parent"
115-
android:enabled="false"
116-
android:text="@string/label_5"/>
106+
android:checked="false"
107+
android:enabled="true"
108+
android:paddingStart="@dimen/padding_start"
109+
android:text="@string/radiobutton_text"/>
117110
</RadioGroup>
118111
```
119112

Loading
Loading
Binary file not shown.

0 commit comments

Comments
 (0)