Skip to content

[Button] The icon and label text are not grouped together in a Button #4977

@charmins

Description

@charmins

Description: The icon and label text should be grouped together with an 8dp spacing as specified in the MD3 spec.

Image

Expected behavior: MD3 Button guideline

Image

Source code: Sample layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="vertical"
    android:paddingHorizontal="16dp">

    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Add"
        app:icon="@drawable/ic_round_add_24dp" />

    <Button
        style="@style/Widget.Material3.Button.TonalButton.Icon"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Add"
        app:icon="@drawable/ic_round_add_24dp" />
    
</LinearLayout>

Android API version: 36

Material Library version: 1.14.0-alpha07

Device: Any

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions