Don't force the user out of touch mode. #167
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First time contributor checklist
Contributor checklist
using the
Fixes #1234
syntaxDescription
Commit b9f48b2 made the SpeedDialView call requestFocusFromTouch() for
the first FAB upon toggle(). However, requestFocusFromTouch() will
force the user out of touch mode and the direct impact on UI is that
the first FAB gains a focused effect and stands out from other FABs.
This isn't the desired behavior because buttons, unlike text fields,
should never gain focus in touch mode, and this is unexpected for most
users (without a keyboard/trackball), both the behavior and the
look-and-feel. The official guidance on touch mode can be found at
https://android-developers.googleblog.com/2008/12/touch-mode.html ,
and the tl;dr is that "Do not try to keep the focus or selection in
touch mode", plus the implied don't force users out of touch mode as
users only enter touch mode when they start to use a keyboard or
trackball. If the user is already using a keyboard or trackball, then
they won't be in touch mode and the regular requestFocus() will just
work for them. This is also consistent with the speed dial
implementation that can be found in Google apps and I assume that they
have proper a11y support.