material-components / material-components/material-components-android
[TextInputLayout] Allow setting the hint expanded and collapsed color independently of the focus state
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
Right now it's not possible to set a fixed color for the collapsed hint, and a fixed color for the expanded hint. Based on the current API and styles available, we can only set the hint text color for when there's focus, and for when there isn't.
The [current documentation](https://material.io/develop/android/components/text-fields/) says that `app:hintTextColor` controls the "Collapsed (floating) color", but that's not the case -- it actually controls the color of the hint for when the field has focus.
**Describe the solution you'd like**
One solution would be to expose a way to call `setCollapsedTextColor()` and `setExpandedTextColor()` from the `CollapsingTextHelper` that lives within `TextInputLayout`. Ideally we'd be able to control that with styles as well. But any way that allows us to decouple the hint color from the focus would work.
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 TextInputLayout and its CollapsingTextHelper, then inspect how app:hintTextColor currently maps to focus state. Confirm the existing documentation behavior and identify the relevant style attributes or APIs; done means expanded and collapsed hint colors can be configured independently of focus.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100