android-times-square icon indicating copy to clipboard operation
android-times-square copied to clipboard

Individual dates not selectable via keyboard

Open martygeek opened this issue 7 years ago • 4 comments
trafficstars

I cannot select a date using the keyboard. We have a requirement to support accessibility and when the calendar view opens, the tab key only allows selection of the entire month. There doesn't seem to be a way, via keyboard tab key or arrow keys, to navigate between days and select a date.

Any ideas on how to make dates keyboard selectable?

martygeek avatar Apr 17 '18 18:04 martygeek

@martygeek I'd be open to a PR but I don't have any ideas on how to go about it. Probably best to start here: https://developer.android.com/training/keyboard-input/navigation.html

edenman avatar Apr 17 '18 20:04 edenman

It should be fairly simple stuff to add. Accessibility for keyboard nav means the user should be able to direct focus to the elements on the screen using the tab or arrow keys. In xml, you can set 'android:focusable="true"' to a view and then the tab key on the keyboard will focus on that view.

martygeek avatar Apr 17 '18 21:04 martygeek

Sounds good, go for it.

edenman avatar Apr 17 '18 21:04 edenman

since the calendar is a listview, adding that in XML might be a problem You might need 'listView.setFocusableInTouchMode(true);' or 'listView. setItemsCanFocus(true)'. You might also have to explicitly set focus on the view in the listview with android:descendantFocusability="afterDescendants" and then listview.AddFocusables(ArrayList<View>, int direction, int focusableMode)

martygeek avatar Apr 17 '18 21:04 martygeek