@@ -71,7 +71,7 @@ Here's what a typical layout would look like:
7171 android : layout_margin =" 16dp" >
7272
7373 <!-- floating toolbar sample content -->
74- <LinearLayout
74+ <com .google.android.material.overflow.OverflowLinearLayout
7575 android : id =" @+id/floating_toolbar_child"
7676 android : layout_width =" wrap_content"
7777 android : layout_height =" wrap_content"
@@ -85,7 +85,9 @@ Here's what a typical layout would look like:
8585 android : layout_height =" wrap_content"
8686 android : checkable =" true"
8787 android : contentDescription =" @string/bold_button_content_description"
88- app : icon =" @drawable/ic_format_bold_24px" />
88+ app : icon =" @drawable/ic_format_bold_24px"
89+ app : layout_overflowText =" @string/bold_button"
90+ app : layout_overflowIcon =" @drawable/ic_format_bold_24px" />
8991
9092 <Button
9193 android : id =" @+id/floating_toolbar_button_italic"
@@ -94,7 +96,9 @@ Here's what a typical layout would look like:
9496 android : layout_height =" wrap_content"
9597 android : checkable =" true"
9698 android : contentDescription =" @string/italic_button_content_description"
97- app : icon =" @drawable/ic_format_italic_24px" />
99+ app : icon =" @drawable/ic_format_italic_24px"
100+ app : layout_overflowText =" @string/italic_button"
101+ app : layout_overflowIcon =" @drawable/ic_format_italic_24px" />
98102
99103 <Button
100104 android : id =" @+id/floating_toolbar_button_underlined"
@@ -103,8 +107,10 @@ Here's what a typical layout would look like:
103107 android : layout_height =" wrap_content"
104108 android : checkable =" true"
105109 android : contentDescription =" @string/underlined_button_content_description"
106- app : icon =" @drawable/ic_format_underlined_24px" />
107- </LinearLayout >
110+ app : icon =" @drawable/ic_format_underlined_24px"
111+ app : layout_overflowText =" @string/underlined_button"
112+ app : layout_overflowIcon =" @drawable/ic_format_underlined_24px" />
113+ </com .google.android.material.overflow.OverflowLinearLayout>
108114
109115 </com .google.android.material.floatingtoolbar.FloatingToolbarLayout>
110116```
@@ -117,8 +123,8 @@ automatically adding items to an overflow button when there's not enough screen
117123space to show all the items.
118124
119125When using ` OverflowLinearLayout ` , you should also set ` app:layout_overflowText `
120- on each child that will show as the text of the menu item that corresponds to
121- the hidden child. Optionally, you can also set ` app:layout_overflowIcon ` . See
126+ as that will be the text of the menu item that corresponds to the hidden child.
127+ Optionally, you can also set ` app:layout_overflowIcon ` . See
122128[ OverflowLinearLayout] ( https://github.com/material-components/material-components-android/tree/master//docs/components/Overflow.md )
123129for more info.
124130
0 commit comments