Example usage for android.support.v4.view.accessibility AccessibilityEventCompat TYPE_WINDOW_CONTENT_CHANGED

List of usage examples for android.support.v4.view.accessibility AccessibilityEventCompat TYPE_WINDOW_CONTENT_CHANGED

Introduction

In this page you can find the example usage for android.support.v4.view.accessibility AccessibilityEventCompat TYPE_WINDOW_CONTENT_CHANGED.

Prototype

int TYPE_WINDOW_CONTENT_CHANGED

To view the source code for android.support.v4.view.accessibility AccessibilityEventCompat TYPE_WINDOW_CONTENT_CHANGED.

Click Source Link

Document

Represents the event of changing the content of a window.

Usage

From source file:android.support.design.widget.CheckableImageButton.java

@Override
public void setChecked(boolean checked) {
    if (mChecked != checked) {
        mChecked = checked;/* w  ww.  j  a  va  2s  .c o m*/
        refreshDrawableState();
        sendAccessibilityEvent(AccessibilityEventCompat.TYPE_WINDOW_CONTENT_CHANGED);
    }
}

From source file:com.android.screenspeak.eventprocessor.ProcessorScrollPosition.java

private boolean shouldIgnoreEvent(AccessibilityEvent event) {
    switch (event.getEventType()) {
    case AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUSED:
    case AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED:
        return true;
    case AccessibilityEventCompat.TYPE_WINDOW_CONTENT_CHANGED:
    case AccessibilityEventCompat.TYPE_VIEW_SCROLLED:
        return shouldIgnoreUpdateListEvent(event);
    default://from  ww  w  .  jav  a  2s  . c  om
        return false;
    }
}

From source file:com.google.android.marvin.mytalkback.ProcessorScrollPosition.java

private boolean shouldIgnoreEvent(AccessibilityEvent event) {
    switch (event.getEventType()) {
    case AccessibilityEventCompat.TYPE_WINDOW_CONTENT_CHANGED:
    case AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUSED:
    case AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED:
        return true;
    case AccessibilityEventCompat.TYPE_VIEW_SCROLLED:
        return shouldIgnoreScrollEvent(event);
    default://from www .j a v a 2s. c o  m
        return false;
    }
}

From source file:com.android.inputmethod.accessibility.KeyboardAccessibilityNodeProvider.java

public void onHoverEnterTo(final Key key) {
    final int id = getVirtualViewIdOf(key);
    if (id == View.NO_ID) {
        return;//from  ww w. j  av  a  2  s  . c  o m
    }
    // Start hovering on the key. Because our accessibility model is lift-to-type, we should
    // report the node info without click and long click actions to avoid unnecessary
    // announcements.
    mHoveringNodeId = id;
    // Invalidate the node info of the key.
    sendAccessibilityEventForKey(key, AccessibilityEventCompat.TYPE_WINDOW_CONTENT_CHANGED);
    sendAccessibilityEventForKey(key, AccessibilityEventCompat.TYPE_VIEW_HOVER_ENTER);
}

From source file:android.support.design.internal.NavigationMenuItemView.java

@Override
public void setCheckable(boolean checkable) {
    refreshDrawableState();/*from   ww w. j av a  2  s. c o m*/
    if (mCheckable != checkable) {
        mCheckable = checkable;
        mAccessibilityDelegate.sendAccessibilityEvent(mTextView,
                AccessibilityEventCompat.TYPE_WINDOW_CONTENT_CHANGED);
    }
}

From source file:com.android.inputmethod.accessibility.KeyboardAccessibilityNodeProvider.java

public void onHoverExitFrom(final Key key) {
    mHoveringNodeId = UNDEFINED;/*from   w w w .  j ava2  s. c o  m*/
    // Invalidate the node info of the key to be able to revert the change we have done
    // in {@link #onHoverEnterTo(Key)}.
    sendAccessibilityEventForKey(key, AccessibilityEventCompat.TYPE_WINDOW_CONTENT_CHANGED);
    sendAccessibilityEventForKey(key, AccessibilityEventCompat.TYPE_VIEW_HOVER_EXIT);
}

From source file:org.nekC.android.support.widget.RecyclerView.java

private void dispatchContentChangedIfNecessary() {
    final int flags = mEatenAccessibilityChangeFlags;
    mEatenAccessibilityChangeFlags = 0;/*from  w  ww .  ja  v a 2s . co m*/
    if (flags != 0 && mAccessibilityManager != null && mAccessibilityManager.isEnabled()) {
        final AccessibilityEvent event = AccessibilityEvent.obtain();
        event.setEventType(AccessibilityEventCompat.TYPE_WINDOW_CONTENT_CHANGED);
        AccessibilityEventCompat.setContentChangeTypes(event, flags);
        sendAccessibilityEventUnchecked(event);
    }
}

From source file:android.support.v71.widget.RecyclerView.java

private void dispatchContentChangedIfNecessary() {
    final int flags = mEatenAccessibilityChangeFlags;
    mEatenAccessibilityChangeFlags = 0;// w  ww.  j ava2  s . c o  m
    if (flags != 0 && isAccessibilityEnabled()) {
        final AccessibilityEvent event = AccessibilityEvent.obtain();
        event.setEventType(AccessibilityEventCompat.TYPE_WINDOW_CONTENT_CHANGED);
        AccessibilityEventCompat.setContentChangeTypes(event, flags);
        sendAccessibilityEventUnchecked(event);
    }
}