Skip to content

Commit

Permalink
Send TYPE_VIEW_SELECTED event for changes to SemanticsFlag.isSelected (
Browse files Browse the repository at this point in the history
  • Loading branch information
goderbauer authored Mar 13, 2018
1 parent e61bb9a commit d042b3e
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,13 @@ void updateSemantics(ByteBuffer buffer, String[] strings) {
// Simulate a click so TalkBack announces the change in checked state.
sendAccessibilityEvent(object.id, AccessibilityEvent.TYPE_VIEW_CLICKED);
}
if (mA11yFocusedObject != null && mA11yFocusedObject.id == object.id
&& !object.hadFlag(Flag.IS_SELECTED) && object.hasFlag(Flag.IS_SELECTED)) {
AccessibilityEvent event =
obtainAccessibilityEvent(object.id, AccessibilityEvent.TYPE_VIEW_SELECTED);
event.getText().add(object.label);
sendAccessibilityEvent(event);
}
if (mInputFocusedObject != null && mInputFocusedObject.id == object.id
&& object.hadFlag(Flag.IS_TEXT_FIELD)
&& object.hasFlag(Flag.IS_TEXT_FIELD)) {
Expand Down

0 comments on commit d042b3e

Please sign in to comment.