mirror of
https://github.com/material-components/material-components-android.git
synced 2026-01-20 12:01:46 +08:00
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