material-components-android icon indicating copy to clipboard operation
material-components-android copied to clipboard

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

Open nicbell opened this issue 1 year ago • 5 comments
trafficstars

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 avatar Mar 14 '24 17:03 nicbell

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

image

nicbell avatar Mar 19 '24 12:03 nicbell