Skip to content

Commit 005687d

Browse files
hunterstichdsn5ft
authored andcommitted
[BottomSheet] Fixed main catalog demo cutting off content when screen size is too small.
PiperOrigin-RevId: 742758473
1 parent 960bb4c commit 005687d

File tree

1 file changed

+59
-56
lines changed

1 file changed

+59
-56
lines changed

catalog/java/io/material/catalog/bottomsheet/res/layout/cat_bottomsheet_standard_content.xml

Lines changed: 59 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -21,67 +21,70 @@
2121
android:layout_width="match_parent"
2222
android:layout_height="wrap_content"/>
2323

24-
<TextView
25-
android:id="@+id/textView"
26-
android:layout_width="wrap_content"
27-
android:layout_height="wrap_content"
28-
android:layout_below="@id/drag_handle"
29-
android:layout_centerHorizontal="true"
30-
android:text="@string/cat_bottomsheet_persistent"
31-
android:textColor="?attr/colorOnSurface"
32-
android:textSize="18sp"/>
24+
<androidx.core.widget.NestedScrollView
25+
android:layout_width="match_parent"
26+
android:layout_height="wrap_content"
27+
android:layout_below="@id/drag_handle">
3328

34-
<TextView
35-
android:id="@+id/cat_persistent_bottomsheet_state"
36-
android:layout_width="wrap_content"
29+
<LinearLayout
30+
android:layout_width="match_parent"
3731
android:layout_height="wrap_content"
38-
android:layout_marginTop="16dp"
39-
android:layout_below="@id/textView"
40-
android:layout_centerHorizontal="true"
41-
android:text="@string/cat_bottomsheet_state_collapsed"
42-
android:textColor="?attr/colorOnSurface"
43-
android:textSize="18sp"/>
32+
android:orientation="vertical"
33+
android:gravity="center_horizontal">
4434

45-
<com.google.android.material.textfield.TextInputLayout
46-
android:id="@+id/cat_persistent_bottomsheet_textinputlayout"
47-
android:layout_width="@dimen/material_textinput_default_width"
48-
android:layout_height="wrap_content"
49-
android:layout_below="@id/cat_persistent_bottomsheet_state"
50-
android:layout_centerHorizontal="true"
51-
android:layout_margin="16dp"
52-
android:layout_gravity="center_horizontal"
53-
android:hint="@string/cat_bottomsheet_textfield_label">
54-
<com.google.android.material.textfield.TextInputEditText
55-
android:layout_width="match_parent"
56-
android:layout_height="wrap_content"/>
57-
</com.google.android.material.textfield.TextInputLayout>
35+
<TextView
36+
android:id="@+id/textView"
37+
android:layout_width="wrap_content"
38+
android:layout_height="wrap_content"
39+
android:text="@string/cat_bottomsheet_persistent"
40+
android:textColor="?attr/colorOnSurface"
41+
android:textSize="18sp" />
5842

59-
<Button
60-
android:id="@+id/cat_bottomsheet_button"
61-
android:layout_width="wrap_content"
62-
android:layout_height="wrap_content"
63-
android:layout_below="@id/cat_persistent_bottomsheet_textinputlayout"
64-
android:layout_centerHorizontal="true"
65-
android:text="@string/cat_bottomsheet_button_label_enabled"/>
43+
<TextView
44+
android:id="@+id/cat_persistent_bottomsheet_state"
45+
android:layout_width="wrap_content"
46+
android:layout_height="wrap_content"
47+
android:layout_marginTop="16dp"
48+
android:text="@string/cat_bottomsheet_state_collapsed"
49+
android:textColor="?attr/colorOnSurface"
50+
android:textSize="18sp" />
6651

67-
<com.google.android.material.materialswitch.MaterialSwitch
68-
android:id="@+id/cat_bottomsheet_enabled_switch"
69-
android:layout_width="wrap_content"
70-
android:layout_height="wrap_content"
71-
android:layout_below="@id/cat_bottomsheet_button"
72-
android:layout_centerHorizontal="true"
73-
android:layout_marginTop="16dp"
74-
android:text="@string/cat_bottomsheet_button_label_enabled"
75-
android:checked="true"/>
52+
<com.google.android.material.textfield.TextInputLayout
53+
android:id="@+id/cat_persistent_bottomsheet_textinputlayout"
54+
android:layout_width="@dimen/material_textinput_default_width"
55+
android:layout_height="wrap_content"
56+
android:layout_margin="16dp"
57+
android:layout_gravity="center_horizontal"
58+
android:hint="@string/cat_bottomsheet_textfield_label">
59+
<com.google.android.material.textfield.TextInputEditText
60+
android:layout_width="match_parent"
61+
android:layout_height="wrap_content" />
62+
</com.google.android.material.textfield.TextInputLayout>
7663

77-
<com.google.android.material.materialswitch.MaterialSwitch
78-
android:id="@+id/cat_bottomsheet_hideable_switch"
79-
android:layout_width="wrap_content"
80-
android:layout_height="wrap_content"
81-
android:layout_below="@id/cat_bottomsheet_enabled_switch"
82-
android:layout_centerHorizontal="true"
83-
android:layout_marginTop="16dp"
84-
android:text="@string/cat_bottomsheet_hideable_switch_text"
85-
android:checked="false"/>
64+
<Button
65+
android:id="@+id/cat_bottomsheet_button"
66+
android:layout_width="wrap_content"
67+
android:layout_height="wrap_content"
68+
android:text="@string/cat_bottomsheet_button_label_enabled" />
69+
70+
<com.google.android.material.materialswitch.MaterialSwitch
71+
android:id="@+id/cat_bottomsheet_enabled_switch"
72+
android:layout_width="wrap_content"
73+
android:layout_height="wrap_content"
74+
android:layout_marginTop="16dp"
75+
android:checked="true"
76+
android:text="@string/cat_bottomsheet_button_label_enabled" />
77+
78+
<com.google.android.material.materialswitch.MaterialSwitch
79+
android:id="@+id/cat_bottomsheet_hideable_switch"
80+
android:layout_width="wrap_content"
81+
android:layout_height="wrap_content"
82+
android:layout_marginTop="16dp"
83+
android:checked="false"
84+
android:text="@string/cat_bottomsheet_hideable_switch_text" />
85+
86+
</LinearLayout>
87+
88+
</androidx.core.widget.NestedScrollView>
8689

8790
</merge>

0 commit comments

Comments
 (0)