Search in sources :

Example 1 with AnimatorAdapter

use of com.saulmm.material.utils.AnimatorAdapter in project Android-Material-Examples by saulmm.

the class TransitionSecondActivity method onBackPressed.

@Override
public void onBackPressed() {
    for (int i = 0; i < rowContainer.getChildCount(); i++) {
        View rowView = rowContainer.getChildAt(i);
        ViewPropertyAnimator propertyAnimator = rowView.animate().setStartDelay(i * SCALE_DELAY).scaleX(0).scaleY(0).setListener(new AnimatorAdapter() {

            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                finishAfterTransition();
            }
        });
    }
}
Also used : AnimatorAdapter(com.saulmm.material.utils.AnimatorAdapter) Animator(android.animation.Animator) ViewPropertyAnimator(android.view.ViewPropertyAnimator) View(android.view.View) ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Aggregations

Animator (android.animation.Animator)1 View (android.view.View)1 ViewPropertyAnimator (android.view.ViewPropertyAnimator)1 AnimatorAdapter (com.saulmm.material.utils.AnimatorAdapter)1