Example usage for android.transition ChangeClipBounds ChangeClipBounds

List of usage examples for android.transition ChangeClipBounds ChangeClipBounds

Introduction

In this page you can find the example usage for android.transition ChangeClipBounds ChangeClipBounds.

Prototype

public ChangeClipBounds() 

Source Link

Usage

From source file:net.huannguyen.conductorexample.transition.DetailPushTransChangeHandler.java

@NonNull
@Override/*from ww w.j a  v a 2s .  co  m*/
protected Transition getTransition(@NonNull ViewGroup container, @Nullable View from, @Nullable View to,
        boolean isPush) {

    if (to == null || !(to instanceof CountryDetailView)) {
        throw new IllegalArgumentException("The to view must be a CountryDetailView");
    }

    final CountryDetailView detailView = (CountryDetailView) to;

    detailView.flagView.setTransitionName(flagViewTransitionName);

    ChangeTransform changeTransform = new ChangeTransform();

    // Shared elements (the flag view in this case) are drawn in the window's view overlay during the transition by default.
    // That causes the favourite fab being drawn behind the flag when it is scaled up.
    // Setting the change transform not using overlay addresses this issue.
    changeTransform.setReparentWithOverlay(false);

    return new TransitionSet()
            .addTransition(new TransitionSet().addTransition(new ChangeBounds())
                    .addTransition(new ChangeClipBounds()).addTransition(changeTransform)
                    .addTransition(new ChangeImageTransform()).setDuration(300))
            .addTransition(new Slide().addTarget(detailView.detailGroup).setStartDelay(150))
            .addTransition(new Scale().addTarget(detailView.favouriteFab).setStartDelay(300))
            .setInterpolator(new FastOutSlowInInterpolator());
}