Example usage for android.view.accessibility AccessibilityEvent TYPE_WINDOW_CONTENT_CHANGED

List of usage examples for android.view.accessibility AccessibilityEvent TYPE_WINDOW_CONTENT_CHANGED

Introduction

In this page you can find the example usage for android.view.accessibility AccessibilityEvent TYPE_WINDOW_CONTENT_CHANGED.

Prototype

int TYPE_WINDOW_CONTENT_CHANGED

To view the source code for android.view.accessibility AccessibilityEvent TYPE_WINDOW_CONTENT_CHANGED.

Click Source Link

Document

Represents the event of changing the content of a window and more specifically the sub-tree rooted at the event's source.

Usage

From source file:org.chromium.chrome.browser.tab.Tab.java

/**
 * Update whether or not the current native tab and/or web contents are
 * currently visible (from an accessibility perspective), or whether
 * they're obscured by another view.//from w ww  .  j  a  v  a2  s. com
 */
public void updateAccessibilityVisibility() {
    View view = getView();
    if (view != null) {
        int importantForAccessibility = isObscuredByAnotherViewForAccessibility()
                ? View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
                : View.IMPORTANT_FOR_ACCESSIBILITY_YES;
        if (view.getImportantForAccessibility() != importantForAccessibility) {
            view.setImportantForAccessibility(importantForAccessibility);
            view.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
        }
    }

    ContentViewCore cvc = getContentViewCore();
    if (cvc != null) {
        boolean isWebContentObscured = isObscuredByAnotherViewForAccessibility() || isShowingSadTab();
        cvc.setObscuredByAnotherView(isWebContentObscured);
    }
}

From source file:com.klinker.android.launcher.launcher3.Launcher.java

/**
 * Opens the user folder described by the specified tag. The opening of the folder
 * is animated relative to the specified View. If the View is null, no animation
 * is played./*from w  ww .  ja  va  2s.  com*/
 *
 * @param folderInfo The FolderInfo describing the folder to open.
 */
public void openFolder(FolderIcon folderIcon) {
    Folder folder = folderIcon.getFolder();
    Folder openFolder = mWorkspace != null ? mWorkspace.getOpenFolder() : null;
    if (openFolder != null && openFolder != folder) {
        // Close any open folder before opening a folder.
        closeFolder();
    }

    FolderInfo info = folder.mInfo;

    info.opened = true;

    // While the folder is open, the position of the icon cannot change.
    ((CellLayout.LayoutParams) folderIcon.getLayoutParams()).canReorder = false;

    // Just verify that the folder hasn't already been added to the DragLayer.
    // There was a one-off crash where the folder had a parent already.
    if (folder.getParent() == null) {
        mDragLayer.addView(folder);
        mDragController.addDropTarget((DropTarget) folder);
    } else {
        Log.w(TAG, "Opening folder (" + folder + ") which already has a parent (" + folder.getParent() + ").");
    }
    folder.animateOpen();
    growAndFadeOutFolderIcon(folderIcon);

    // Notify the accessibility manager that this folder "window" has appeared and occluded
    // the workspace items
    folder.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
    getDragLayer().sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
}

From source file:com.android.launcher3.Launcher.java

/**
 * Opens the user folder described by the specified tag. The opening of the folder
 * is animated relative to the specified View. If the View is null, no animation
 * is played./*from  w  w  w .ja  v a 2 s . c o m*/
 *
 * @param folderIcon The FolderIcon describing the folder to open.
 */
public void openFolder(FolderIcon folderIcon) {

    Folder folder = folderIcon.getFolder();
    Folder openFolder = mWorkspace != null ? mWorkspace.getOpenFolder() : null;
    if (openFolder != null && openFolder != folder) {
        // Close any open folder before opening a folder.
        closeFolder();
    }

    FolderInfo info = folder.mInfo;

    info.opened = true;

    // While the folder is open, the position of the icon cannot change.
    ((CellLayout.LayoutParams) folderIcon.getLayoutParams()).canReorder = false;

    // Just verify that the folder hasn't already been added to the DragLayer.
    // There was a one-off crash where the folder had a parent already.
    if (folder.getParent() == null) {
        mDragLayer.addView(folder);
        mDragController.addDropTarget(folder);
    } else {
        Log.w(TAG, "Opening folder (" + folder + ") which already has a parent (" + folder.getParent() + ").");
    }
    folder.animateOpen();

    growAndFadeOutFolderIcon(folderIcon);

    // Notify the accessibility manager that this folder "window" has appeared and occluded
    // the workspace items
    folder.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
    getDragLayer().sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
}