Java Code Examples for android.view.accessibility.AccessibilityEvent#CONTENT_CHANGE_TYPE_PANE_DISAPPEARED

The following examples show how to use android.view.accessibility.AccessibilityEvent#CONTENT_CHANGE_TYPE_PANE_DISAPPEARED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WindowTransitionInfo.java    From talkback with Apache License 2.0 6 votes vote down vote up
private static boolean shouldIgnorePaneChanges(AccessibilityEvent event) {
  if (!BuildVersionUtils.isAtLeastP()
      || (event.getEventType() != AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED)) {
    return false;
  }
  if (event.getContentChangeTypes() == AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_DISAPPEARED) {
    // The event text is the title of pane being removed.
    return true;
  }

  // . We need to differentiate between pane changes with CONTENT_CHANGE_TYPE_UNDEFINED,
  // and events filed by getDecorView().sendAccessibilityEvent(WINDOW_STATE_CHANGE). The only way
  // I can find is to check whether the source node is null.
  return (event.getContentChangeTypes() == AccessibilityEvent.CONTENT_CHANGE_TYPE_UNDEFINED)
      && !AccessibilityEventUtils.hasSourceNode(event);
}
 
Example 2
Source File: WindowEventInterpreter.java    From talkback with Apache License 2.0 5 votes vote down vote up
@TargetApi(Build.VERSION_CODES.P)
private static String contentChangeTypesToString(int typesBitmask) {
  StringBuilder strings = new StringBuilder();
  if ((typesBitmask & AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_TITLE) != 0) {
    strings.append("CONTENT_CHANGE_TYPE_PANE_TITLE");
  }
  if ((typesBitmask & AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_APPEARED) != 0) {
    strings.append("CONTENT_CHANGE_TYPE_PANE_APPEARED");
  }
  if ((typesBitmask & AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_DISAPPEARED) != 0) {
    strings.append("CONTENT_CHANGE_TYPE_PANE_DISAPPEARED");
  }
  return (strings.length() == 0) ? null : strings.toString();
}