Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MaterialButton] iconSize does not always match Material 3 specs #3428

Open
seadowg opened this issue May 29, 2023 · 1 comment
Open

[MaterialButton] iconSize does not always match Material 3 specs #3428

seadowg opened this issue May 29, 2023 · 1 comment
Assignees

Comments

@seadowg
Copy link

seadowg commented May 29, 2023

Description: The Material 3 MaterialButton style Widget.Material3.Button.OutlinedButton.Icon does not specify an iconSize so this remains at the default wrap_content rather than the 18dp value defined in the Material 3 spec.

Expected behavior: Material 3 Button .Icon styles (or their parents) should all specify a default app:iconSize of 18dp.

Source code:

<com.google.android.material.button.MaterialButton
    style="@style/Widget.Material3.Button.OutlinedButton.Icon"
    app:icon="@drawable/ic_save"/>

The icon displayed by this button will be as large as the icon itself (due to MaterialButton using wrap_content for iconSize by default).

Material Library version: 1.7.0

@seadowg seadowg added the bug label May 29, 2023
@seadowg seadowg changed the title [MaterialButton] iconSize does not match Material 3 specs [MaterialButton] iconSize does not always match Material 3 specs May 29, 2023
@afohrman
Copy link
Contributor

Thanks so much for reporting this, @seadowg. MaterialButtons should all have a default 18dp iconSize, but it looks like some MaterialButton styles don't inherit from the base Widget.Material3.Button style where that default iconSize is set. We need to either simplify M3 button style inheritance so that all styles inherit from Widget.Material3.Button and the default iconSize is used for all M3 button styles, or just add iconSize to Widget.Material3.Button.TextButton so that all button styles that inherit from Widget.Material3.Button.TextButton get that iconSize.

@afohrman afohrman self-assigned this May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants