Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CardInputWidget to use TextInputLayout #2029

Merged
merged 1 commit into from
Jan 7, 2020

Conversation

mshafrir-stripe
Copy link
Collaborator

@mshafrir-stripe mshafrir-stripe commented Jan 7, 2020

Motivation
TextInputLayout offers some accessibility benefits [0], and also
allows adding helper text that is separate from hint text. This can
be used to set a hint text of "Card Number" and helper text of
"1234 1234 1234 1234".

Summary

  • Update CardInputWidget to apply layout logic to TextInputLayout
    instead of StripeEditText views.
  • Set contentDescription on TextInputLayout for accessibility/TalkBack
  • Remove invisible TextViews used for accessibility-only
  • Remove unnecessary tools:importantForAccessibility
  • Make StripeEditText extend TextInputEditText [1]

[0] https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout
[1] https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText

Testing
Tested on real device with TalkBack enabled

ciw

Motivation:
`TextInputLayout` offers some accessibility benefits [0], and also
allows adding helper text that is separate from hint text. This can
be used to set a hint text of "Card Number" and helper text of
"1234 1234 1234 1234".

Summary:
- Update `CardInputWidget` to apply layout logic to `TextInputLayout`
  instead of `StripeEditText` views.
- Set `contentDescription` on `TextInputLayout` for accessibility/TalkBack
- Remove invisible `TextView`s used for accessibility-only
- Remove unnecessary `tools:importantForAccessibility`
- Make `StripeEditText` extend `TextInputEditText` [1]

[0] https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout
[1] https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText

Testing:
Tested on real device with TalkBack enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants