@@ -19,7 +19,7 @@ Use radio buttons to:
19
19
* If available options can be collapsed, consider using a dropdown menu
20
20
instead, as it uses less space.
21
21
22
- ![ Settings menu with radio buttons for ringtones ] ( assets/radiobutton/radiobutton_hero .png )
22
+ ![ Settings menu with radio buttons] ( assets/radiobutton/radiobutton .png )
23
23
24
24
** Contents**
25
25
@@ -75,45 +75,38 @@ API and source code:
75
75
76
76
### Radio buttons example
77
77
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.
79
79
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 )
82
81
83
82
In the layout:
84
83
85
84
``` xml
86
85
<RadioGroup
87
- android : id =" @+id/radioGroup"
88
- android : checkedButton =" @+id/radio_button_1"
86
+ android : checkedButton =" @+id/enabled_selected"
89
87
android : layout_width =" match_parent"
90
88
android : layout_height =" wrap_content" >
91
89
<RadioButton
92
- android : id =" @+id/radio_button_1 "
90
+ android : id =" @+id/enabled_selected "
93
91
android : layout_width =" match_parent"
94
92
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" />
96
96
<RadioButton
97
- android : id =" @+id/radio_button_2"
98
97
android : layout_width =" match_parent"
99
98
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" />
101
103
<RadioButton
102
- android : id =" @+id/radio_button_3"
103
104
android : layout_width =" match_parent"
104
105
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" />
117
110
</RadioGroup >
118
111
```
119
112
0 commit comments