material-components / material-components/material-components-android
[Buttons] Max-width of buttons from component source code is not being respected
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
**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.
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/java/com/google/android/material/button/res/values/dimens.xml and styles.xml at the linked lines, then reproduce the Android Studio VisualLintButtonSize warning with Material Library 1.11. Trace why the declared 320dp maximum is not applied; done means buttons respect that maximum by default without requiring tools:ignore="VisualLintButtonSize".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100