Search in sources :

Example 1 with TransitionAdapter

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

the class TransitionSecondActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_transition_second);
    rowContainer = (LinearLayout) findViewById(R.id.row_container2);
    Slide slideExitTransition = new Slide(Gravity.BOTTOM);
    slideExitTransition.excludeTarget(android.R.id.navigationBarBackground, true);
    slideExitTransition.excludeTarget(android.R.id.statusBarBackground, true);
    getWindow().getEnterTransition().addListener(new TransitionAdapter() {

        @Override
        public void onTransitionEnd(Transition transition) {
            super.onTransitionEnd(transition);
            getWindow().getEnterTransition().removeListener(this);
            for (int i = 0; i < rowContainer.getChildCount(); i++) {
                View rowView = rowContainer.getChildAt(i);
                rowView.animate().setStartDelay(i * SCALE_DELAY).scaleX(1).scaleY(1);
            }
        }
    });
}
Also used : Slide(android.transition.Slide) TransitionAdapter(com.saulmm.material.utils.TransitionAdapter) Transition(android.transition.Transition) View(android.view.View)

Aggregations

Slide (android.transition.Slide)1 Transition (android.transition.Transition)1 View (android.view.View)1 TransitionAdapter (com.saulmm.material.utils.TransitionAdapter)1