use of com.hackvg.android.views.custom_listeners.TransitionAdapter in project Material-Movies by saulmm.
the class MovieDetailActivity method configureEnterTransition.
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void configureEnterTransition() {
getWindow().setSharedElementEnterTransition(TransitionUtils.makeSharedElementEnterTransition(this));
postponeEnterTransition();
int moviePosition = getIntent().getIntExtra(MoviesActivity.EXTRA_MOVIE_POSITION, 0);
mCoverImageView.setTransitionName(MoviesActivity.SHARED_ELEMENT_COVER + moviePosition);
mObservableScrollView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
mObservableScrollView.getViewTreeObserver().removeOnPreDrawListener(this);
startPostponedEnterTransition();
return true;
}
});
getWindow().getSharedElementEnterTransition().addListener(new TransitionAdapter() {
@Override
public void onTransitionEnd(Transition transition) {
super.onTransitionEnd(transition);
animateElementsByScale();
}
});
}
Aggregations