Search in sources :

Example 1 with ChangeClipBounds

use of android.transition.ChangeClipBounds in project Conductor by bluelinelabs.

the class ArcFadeMoveChangeHandler method getTransition.

@Override
@NonNull
protected Transition getTransition(@NonNull ViewGroup container, View from, View to, boolean isPush) {
    TransitionSet transition = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL).addTransition(new Fade(Fade.OUT)).addTransition(new TransitionSet().addTransition(new ChangeBounds()).addTransition(new ChangeClipBounds()).addTransition(new ChangeTransform())).addTransition(new Fade(Fade.IN));
    transition.setPathMotion(new ArcMotion());
    return transition;
}
Also used : ChangeTransform(android.transition.ChangeTransform) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) Fade(android.transition.Fade) ArcMotion(android.transition.ArcMotion) ChangeClipBounds(android.transition.ChangeClipBounds) NonNull(android.support.annotation.NonNull)

Example 2 with ChangeClipBounds

use of android.transition.ChangeClipBounds in project Conductor by bluelinelabs.

the class ArcFadeMoveChangeHandler method getSharedElementTransition.

@Nullable
@Override
public Transition getSharedElementTransition(@NonNull ViewGroup container, @Nullable final View from, @Nullable View to, boolean isPush) {
    Transition transition = new TransitionSet().addTransition(new ChangeBounds()).addTransition(new ChangeClipBounds()).addTransition(new ChangeTransform());
    transition.setPathMotion(new ArcMotion());
    // The framework doesn't totally fade out the "from" shared element, so we'll hide it manually once it's safe.
    transition.addListener(new TransitionListener() {

        @Override
        public void onTransitionStart(Transition transition) {
            if (from != null) {
                for (String name : sharedElementNames) {
                    View namedView = TransitionUtils.findNamedView(from, name);
                    if (namedView != null) {
                        namedView.setVisibility(View.INVISIBLE);
                    }
                }
            }
        }

        @Override
        public void onTransitionEnd(Transition transition) {
        }

        @Override
        public void onTransitionCancel(Transition transition) {
        }

        @Override
        public void onTransitionPause(Transition transition) {
        }

        @Override
        public void onTransitionResume(Transition transition) {
        }
    });
    return transition;
}
Also used : ChangeTransform(android.transition.ChangeTransform) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) Transition(android.transition.Transition) TransitionListener(android.transition.Transition.TransitionListener) View(android.view.View) ArcMotion(android.transition.ArcMotion) ChangeClipBounds(android.transition.ChangeClipBounds) Nullable(android.support.annotation.Nullable)

Aggregations

ArcMotion (android.transition.ArcMotion)2 ChangeBounds (android.transition.ChangeBounds)2 ChangeClipBounds (android.transition.ChangeClipBounds)2 ChangeTransform (android.transition.ChangeTransform)2 TransitionSet (android.transition.TransitionSet)2 NonNull (android.support.annotation.NonNull)1 Nullable (android.support.annotation.Nullable)1 Fade (android.transition.Fade)1 Transition (android.transition.Transition)1 TransitionListener (android.transition.Transition.TransitionListener)1 View (android.view.View)1