Example usage for android.view.accessibility AccessibilityEvent TYPE_WINDOW_STATE_CHANGED

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

Introduction

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

Prototype

int TYPE_WINDOW_STATE_CHANGED

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

Click Source Link

Document

Represents the event of a change to a visually distinct section of the user interface.

Usage

From source file:android.support.v7.app.ActionBarImplBase.java

public ActionMode startActionMode(ActionMode.Callback callback) {
    if (mActionMode != null) {
        mActionMode.finish();/*from w  w w  . j a va 2s.  c om*/
    }

    mContextView.killMode();
    ActionModeImpl mode = new ActionModeImpl(callback);
    if (mode.dispatchOnCreate()) {
        mode.invalidate();
        mContextView.initForMode(mode);
        animateToMode(true);
        if (mSplitView != null && mContextDisplayMode == CONTEXT_DISPLAY_SPLIT) {
            if (mSplitView.getVisibility() != View.VISIBLE) {
                mSplitView.setVisibility(View.VISIBLE);
            }
        }
        mContextView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
        mActionMode = mode;
        return mode;
    }
    return null;
}

From source file:me.bemind.sidemenu.SideMenu.java

void dispatchOnPanelClosed(View panel, View bottomPanel) {
    if (mPanelSlideListener != null) {
        mPanelSlideListener.onPanelClosed(panel, bottomPanel);
    }//  w  ww. j  av a 2s  . c o m
    if (mSideMenuToggle != null) {
        mSideMenuToggle.onPanelClosed(panel, bottomPanel);
    }
    sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}

From source file:android.support.v7.internal.app.WindowDecorActionBar.java

public ActionMode startActionMode(ActionMode.Callback callback) {
    if (mActionMode != null) {
        mActionMode.finish();// w ww  . j  a  va2s .com
    }

    mOverlayLayout.setHideOnContentScrollEnabled(false);
    mContextView.killMode();
    ActionModeImpl mode = new ActionModeImpl(mContextView.getContext(), callback);
    if (mode.dispatchOnCreate()) {
        mode.invalidate();
        mContextView.initForMode(mode);
        animateToMode(true);
        if (mSplitView != null && mContextDisplayMode == CONTEXT_DISPLAY_SPLIT) {
            // TODO animate this
            if (mSplitView.getVisibility() != View.VISIBLE) {
                mSplitView.setVisibility(View.VISIBLE);
                if (mOverlayLayout != null) {
                    ViewCompat.requestApplyInsets(mOverlayLayout);
                }
            }
        }
        mContextView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
        mActionMode = mode;
        return mode;
    }
    return null;
}

From source file:com.abewy.android.apps.klyph.widget.KlyphDrawerLayout.java

void dispatchOnDrawerClosed(View drawerView) {
    final LayoutParams lp = (LayoutParams) drawerView.getLayoutParams();
    if (lp.knownOpen) {
        lp.knownOpen = false;/*from ww  w  . j  a va2 s  .  c  o m*/
        if (mListener != null) {
            mListener.onDrawerClosed(drawerView);
        }
        sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
    }
}

From source file:cc.flydev.launcher.Folder.java

public void animateClosed() {
    if (!(getParent() instanceof DragLayer))
        return;//w  w w  . j a  v a  2s .com
    PropertyValuesHolder alpha = PropertyValuesHolder.ofFloat("alpha", 0);
    PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat("scaleX", 0.9f);
    PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", 0.9f);
    final ObjectAnimator oa = LauncherAnimUtils.ofPropertyValuesHolder(this, alpha, scaleX, scaleY);

    oa.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            onCloseComplete();
            setLayerType(LAYER_TYPE_NONE, null);
            mState = STATE_SMALL;
        }

        @Override
        public void onAnimationStart(Animator animation) {
            sendCustomAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED,
                    getContext().getString(R.string.folder_closed));
            mState = STATE_ANIMATING;
        }
    });
    oa.setDuration(mExpandDuration);
    setLayerType(LAYER_TYPE_HARDWARE, null);
    oa.start();
}

From source file:com.lansun.qmyo.view.DrawerLayout.java

void dispatchOnDrawerClosed(View drawerView) {
    final LayoutParams lp = (LayoutParams) drawerView.getLayoutParams();
    if (lp.knownOpen) {
        lp.knownOpen = false;// w  w  w  .j  ava2 s . co m
        if (mListener != null) {
            // --------------------------------------------------------------------------------
            // ?? 
            float minVel = 100 * density;
            mLeftDragger.setMinVelocity(minVel);
            mRightDragger.setMinVelocity(minVel);
            // --------------------------------------------------------------------------------
            mListener.onDrawerClosed(drawerView);
        }
        sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
    }
}

From source file:com.abewy.android.apps.klyph.widget.KlyphDrawerLayout.java

void dispatchOnDrawerOpened(View drawerView) {
    final LayoutParams lp = (LayoutParams) drawerView.getLayoutParams();
    if (!lp.knownOpen) {
        lp.knownOpen = true;//  ww  w.j  a  v  a  2  s  .  co m
        if (mListener != null) {
            mListener.onDrawerOpened(drawerView);
        }
        drawerView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
    }
}

From source file:android.support.v7.internal.widget.ActionBarContextView.java

@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    if (Build.VERSION.SDK_INT >= 14) {
        if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
            // Action mode started
            event.setSource(this);
            event.setClassName(getClass().getName());
            event.setPackageName(getContext().getPackageName());
            event.setContentDescription(mTitle);
        } else {/*from   w  w w .  j  a  v a 2  s . c  o m*/
            super.onInitializeAccessibilityEvent(event);
        }
    }
}

From source file:github.why168.swipeback.view.SwipeBackLayout.java

void dispatchOnPanelClosed(View panel) {
    // ========================  START ========================
    if (mIsWeChatStyle) {
        SwipeBackManager.onPanelClosed();
    }/*from   w w w  .  j  av a 2 s  .co m*/
    // ========================  END ========================

    if (mPanelSlideListener != null) {
        mPanelSlideListener.onPanelClosed(panel);
    }
    sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}

From source file:com.lansun.qmyo.view.DrawerLayout.java

void dispatchOnDrawerOpened(View drawerView) {
    final LayoutParams lp = (LayoutParams) drawerView.getLayoutParams();
    if (!lp.knownOpen) {
        lp.knownOpen = true;/*from   ww w  .  j  av  a2 s.c o  m*/
        if (mListener != null) {
            // --------------------------------------------------------------------------------
            // ?? ???
            float minVel = MIN_FLING_VELOCITY * density;
            mLeftDragger.setMinVelocity(minVel);
            mRightDragger.setMinVelocity(minVel);
            // --------------------------------------------------------------------------------
            mListener.onDrawerOpened(drawerView);
        }
        drawerView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
    }
}