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);
}
Aggregations