Example usage for android.transition Explode setPropagation

List of usage examples for android.transition Explode setPropagation

Introduction

In this page you can find the example usage for android.transition Explode setPropagation.

Prototype

public void setPropagation(TransitionPropagation transitionPropagation) 

Source Link

Document

Sets the method for determining Animator start delays.

Usage

From source file:by.gdgminsk.animationguide.ContactDetailsActivity.java

private void exit() {
    if (mInitialOrientation != mCurrentOrientation || mCurrentCollapsingRate > 0.9f) {
        // remove tranistion name on exit to let activity explode insted of playing
        // reverse shared element animation. Better override return transition and
        // not to play shared element back because if returning activity recreated
        // there is a glitch because the end coordinate of shared element may not exist
        ViewCompat.setTransitionName(mPhotoView, null);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Explode transition = new Explode();
            transition.setPropagation(new CircularPropagation());
            transition.setDuration(getResources().getInteger(R.integer.duration_explode));
            transition.setInterpolator(AnimUtils.EASE_OUT_INTERPOLATOR);
            getWindow().setReturnTransition(transition);
        }//  w ww  . ja  va 2  s .  c  om
    }
    supportFinishAfterTransition();
}