material-components / material-components/material-components-android

[Button] Not able to override disabledAlpha

Open
#1,933 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request Widget: Button
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.