Material Split Button
A container for two MaterialButtons that together create a split button. The s in this group will be shown on a single line.
This layout currently only supports child views of type MaterialButton. Buttons can be added to this view group via XML, as follows:
<com.google.android.material.button.MaterialSplitButton
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/split_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/split_button_label"
app:icon="@drawable/ic_edit_vd_theme_24dp"
app:iconGravity="start"/>
<Button
style="?attr/materialSplitButtonIconFilledStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/split_button_label_chevron"
app:icon="@drawable/m3_split_button_chevron_avd"/>
</com.google.android.material.button.MaterialSplitButton>
Content copied to clipboard
Buttons can also be added to this view group programmatically via the addView methods.
MaterialSplitButton is a MaterialButtonGroup with only two MaterialButtons.
For more information, see the component developer guidance and design guidelines.
Functions
Link copied to clipboard
This override prohibits Views other than MaterialButton to be added where the leading MaterialButton has either an icon and/or a label and the trailing has an animated vector drawable as an icon.