3 Commits

Author SHA1 Message Date
afohrman
2055801374 Add feedback for selected bottom navigation items.
Set the BottomNavigationItemView to selected in setChecked to fix an issue where there was no feedback when a bottom nav item was selected. The solution here also allows for removing the override of onInitializeAccessibilityNodeInfo in favor of BottomNavigationItemView getting selection behavior "for free" from View.

PiperOrigin-RevId: 192717626
2018-04-17 15:54:22 -04:00
afohrman
93e63fa38a Distinguish selected navigation items from unselected navigation items.
Override onInitializeAccessibilityNodeInfo to set the selected state based on whether or not the item is checked. It would be more intuitive to set the AcccessibilityNodeInfo to be checked, since the menu API used for bottom navigation uses checking as opposed to selection, but setChecked does not produce the desire behavior in talkback.

Before this change: Activated item is read out with no indication of its selected state.(ex: "Page 2")
After this change: Activated item is read out with "selected" before its label (ex: "selected, Page 2")

This new behavior is the same behavior seen in tabs.

PiperOrigin-RevId: 192696908
2018-04-17 15:53:51 -04:00
cketcham
a87d71a4ae Move components out of widget
PiperOrigin-RevId: 190828084
2018-04-03 11:55:32 -04:00