material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.11k stars 3.04k forks source link

[Buttons] Max-width of buttons from component source code is not being respected #4102

Open nicbell opened 4 months ago

nicbell commented 4 months ago

Description:

According to the source code Material buttons should be 320dp maximum by default but this not actually working.

This causes warnings in Android Studio.

image

https://github.com/material-components/material-components-android/blob/release-1.11/lib/java/com/google/android/material/button/res/values/dimens.xml#L20

https://github.com/material-components/material-components-android/blob/release-1.11/lib/java/com/google/android/material/button/res/values/styles.xml#L39

The warning can be suppressed with tools:ignore="VisualLintButtonSize" but it would be better to fix the component to behave as specified in the source.

Material Library version: 1.11

nicbell commented 4 months ago

FYI the Android studio warning directly contradicts the Material docs which have full width buttons everywhere.

image