Skip to content

Commit 38124d1

Browse files
imhappidsn5ft
authored andcommitted
[Catalog] Changed checkboxes in checkbox demo to be displayed vertically since there isn't enough horizontal space when font is large
PiperOrigin-RevId: 680664451
1 parent 59a753a commit 38124d1

File tree

1 file changed

+30
-31
lines changed

1 file changed

+30
-31
lines changed

catalog/java/io/material/catalog/checkbox/res/layout/cat_checkbox.xml

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,66 +28,65 @@
2828
android:orientation="vertical"
2929
android:padding="@dimen/cat_checkbox_padding">
3030

31-
<GridLayout
32-
android:layout_width="wrap_content"
33-
android:layout_height="wrap_content"
34-
android:columnCount="3"
35-
android:useDefaultMargins="true">
36-
3731
<TextView
3832
android:layout_width="match_parent"
39-
android:layout_height="match_parent"
40-
android:layout_columnSpan="3"
41-
android:text="@string/cat_checkbox_intro" />
33+
android:layout_height="wrap_content"
34+
android:text="@string/cat_checkbox_intro"
35+
android:layout_marginBottom="@dimen/cat_checkbox_padding"/>
4236

4337
<CheckBox
44-
android:layout_width="match_parent"
45-
android:layout_height="match_parent"
38+
android:layout_width="wrap_content"
39+
android:layout_height="wrap_content"
4640
android:checked="true"
4741
android:enabled="true"
48-
android:text="@string/cat_checkbox_enabled" />
42+
android:text="@string/cat_checkbox_enabled"
43+
android:layout_marginBottom="@dimen/cat_checkbox_padding"/>
4944

5045
<CheckBox
51-
android:layout_width="match_parent"
52-
android:layout_height="match_parent"
46+
android:layout_width="wrap_content"
47+
android:layout_height="wrap_content"
5348
android:checked="false"
5449
android:enabled="true"
55-
android:text="@string/cat_checkbox_enabled" />
50+
android:text="@string/cat_checkbox_enabled"
51+
android:layout_marginBottom="@dimen/cat_checkbox_padding"/>
5652

5753
<CheckBox
58-
android:layout_width="match_parent"
59-
android:layout_height="match_parent"
54+
android:layout_width="wrap_content"
55+
android:layout_height="wrap_content"
6056
app:checkedState="indeterminate"
6157
android:enabled="true"
62-
android:text="@string/cat_checkbox_enabled" />
58+
android:text="@string/cat_checkbox_enabled"
59+
android:layout_marginBottom="@dimen/cat_checkbox_padding"/>
6360

6461
<TextView
6562
android:layout_width="match_parent"
66-
android:layout_height="match_parent"
67-
android:layout_columnSpan="3"
68-
android:text="@string/cat_checkbox_disabled_guide" />
63+
android:layout_height="wrap_content"
64+
android:text="@string/cat_checkbox_disabled_guide"
65+
android:layout_marginBottom="@dimen/cat_checkbox_padding"/>
6966

7067
<CheckBox
71-
android:layout_width="match_parent"
72-
android:layout_height="match_parent"
68+
android:layout_width="wrap_content"
69+
android:layout_height="wrap_content"
7370
android:checked="true"
7471
android:enabled="false"
75-
android:text="@string/cat_checkbox_disabled" />
72+
android:text="@string/cat_checkbox_disabled"
73+
android:layout_marginBottom="@dimen/cat_checkbox_padding"/>
7674

7775
<CheckBox
78-
android:layout_width="match_parent"
79-
android:layout_height="match_parent"
76+
android:layout_width="wrap_content"
77+
android:layout_height="wrap_content"
8078
android:checked="false"
8179
android:enabled="false"
82-
android:text="@string/cat_checkbox_disabled" />
80+
android:text="@string/cat_checkbox_disabled"
81+
android:layout_marginBottom="@dimen/cat_checkbox_padding"/>
8382

8483
<CheckBox
85-
android:layout_width="match_parent"
86-
android:layout_height="match_parent"
84+
android:layout_width="wrap_content"
85+
android:layout_height="wrap_content"
8786
app:checkedState="indeterminate"
8887
android:enabled="false"
89-
android:text="@string/cat_checkbox_disabled" />
90-
</GridLayout>
88+
android:text="@string/cat_checkbox_disabled"
89+
android:layout_marginBottom="@dimen/cat_checkbox_padding"/>
9190

9291
<com.google.android.material.divider.MaterialDivider
9392
android:layout_width="match_parent"

0 commit comments

Comments
 (0)