material-components / material-components/material-components-android
[TextInputLayout] HelperText and Talkback compatibility; able to turn off its accessbility on demand
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.**
When a TextInputLayout has helperText enabled set to true and appropriate texts assigned to the attribute, Talkback reads aloud the helperText on each character input and deletion. When I have it showing, talkback highlights the entire textinputlayout, only reading the helperText but not reading the actual hint nor input of the textinputedittext until an additional swipe to navigate to the field is executed. I've tried making a custom AccessbilityDelegate to work around these default behavior, but I've come across scenario as well where I cannot make the helper text non-accessible like I would on a view element with View.importantForAccessibility attribute.
**Describe the solution you'd like**
I like the accessbilitydelegate idea I had so I'm keeping it; but to simulate a better talkback experience, I opted to removing helperText entirely when talkback is enabled and using a custom textview for similar effect, but I can switch off its accessibility and add its description to the custom accessibilitydelegate for the textinputlayout. Naturally, this created a few unsavory conditions I had to make to balance between non-talkback and talkback modes; same conditons if not more for error handling.
We also happily accept [pull requests](https://github.com/material-components/material-components-android/pulls).
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's helperText accessibility behavior and the custom AccessibilityDelegate described in the issue; inspect how TextInputEditText and TalkBack focus are exposed. Done means callers can control whether helper text is accessible on demand while preserving appropriate access to the field's hint and input, with the behavior checked in TalkBack scenarios.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- accessibility, mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100