material-components / material-components/material-components-android
[Button] Not able to override disabledAlpha
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
Description: I would like to change the alpha value when the button is disabled.
Expected behavior: I would expect that adding android:disabledAlpha would override.
Source code: The alpha value is hardcoded instead of using the attribute android:disabledAlpha
Android API version: 30
Material Library version: 1.2.1
Device: Google Pixel 4
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/color/mtrl_btn_bg_color_selector.xml, especially the hardcoded disabled-state alpha at the linked line. Check how android:disabledAlpha is expected to affect this selector, then verify the result on a disabled Material Button; done means the attribute overrides the default alpha without changing enabled-button behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100