Search in sources :

Example 1 with Explode

use of com.transitionseverywhere.Explode in project Transitions-Everywhere by andkulikov.

the class ExplodeAndEpicenterExample method letsExplodeIt.

private void letsExplodeIt(View clickedView) {
    // save rect of view in screen coordinated
    final Rect viewRect = new Rect();
    clickedView.getGlobalVisibleRect(viewRect);
    TransitionSet set = new TransitionSet().addTransition(new Explode().setEpicenterCallback(new Transition.EpicenterCallback() {

        @Override
        public Rect onGetEpicenter(Transition transition) {
            return viewRect;
        }
    }).excludeTarget(clickedView, true)).addTransition(new Fade().addTarget(clickedView)).addListener(new Transition.TransitionListenerAdapter() {

        @Override
        public void onTransitionEnd(Transition transition) {
            getActivity().onBackPressed();
        }
    });
    TransitionManager.beginDelayedTransition(mRecyclerView, set);
    // remove all views from Recycler View
    mRecyclerView.setAdapter(null);
}
Also used : Explode(com.transitionseverywhere.Explode) Rect(android.graphics.Rect) TransitionSet(com.transitionseverywhere.TransitionSet) Transition(com.transitionseverywhere.Transition) Fade(com.transitionseverywhere.Fade)

Aggregations

Rect (android.graphics.Rect)1 Explode (com.transitionseverywhere.Explode)1 Fade (com.transitionseverywhere.Fade)1 Transition (com.transitionseverywhere.Transition)1 TransitionSet (com.transitionseverywhere.TransitionSet)1