Example usage for android.view View hasTransientState

List of usage examples for android.view View hasTransientState

Introduction

In this page you can find the example usage for android.view View hasTransientState.

Prototype

@ViewDebug.ExportedProperty(category = "layout")
public boolean hasTransientState() 

Source Link

Document

Indicates whether the view is currently tracking transient state that the app should not need to concern itself with saving and restoring, but that the framework should take special note to preserve when possible.

Usage

From source file:com.givewaygames.transition.Transition.java

/**
 * This method is called automatically by the Transition and
 * TransitionSet classes when a transition finishes, either because
 * a transition did nothing (returned a null Animator from
 * {@link com.hirevue.manager.tmp.transition.Transition#createAnimator(android.view.ViewGroup, android.transition.TransitionValues,
 * android.transition.TransitionValues)}) or because the transition returned a valid
 * Animator and end() was called in the onAnimationEnd()
 * callback of the AnimatorListener./*  ww  w  .j  av  a  2  s. c o m*/
 *
 * @hide
 */
protected void end() {
    --mNumInstances;
    if (mNumInstances == 0) {
        if (mListeners != null && mListeners.size() > 0) {
            ArrayList<TransitionListener> tmpListeners = (ArrayList<TransitionListener>) mListeners.clone();
            int numListeners = tmpListeners.size();
            for (int i = 0; i < numListeners; ++i) {
                tmpListeners.get(i).onTransitionEnd(this);
            }
        }
        for (int i = 0; i < mStartValues.itemIdValues.size(); ++i) {
            TransitionValues tv = mStartValues.itemIdValues.valueAt(i);
            View v = tv.view;
            if (v.hasTransientState()) {
                v.setHasTransientState(false);
            }
        }
        for (int i = 0; i < mEndValues.itemIdValues.size(); ++i) {
            TransitionValues tv = mEndValues.itemIdValues.valueAt(i);
            View v = tv.view;
            if (v.hasTransientState()) {
                v.setHasTransientState(false);
            }
        }
        mEnded = true;
    }
}