Transation

https://developer.android.com/reference/android/support/transition/Transition
顺道搜了篇帖子https://www.jianshu.com/p/e497123652b5
在看BottomNavigationView的时候,又点进去BottomNavigationMenuView,完事在里边看到了一些动画代码,就顺道看了下

        mSet = new AutoTransition();
        mSet.setOrdering(TransitionSet.ORDERING_TOGETHER);
        mSet.setDuration(ACTIVE_ANIMATION_DURATION_MS);
        mSet.setInterpolator(new FastOutSlowInInterpolator());
        mSet.addTransition(new TextScale());

go on

public class AutoTransition extends TransitionSet {

    /**
     * Constructs an AutoTransition object, which is a TransitionSet which
     * first fades out disappearing targets, then moves and resizes existing
     * targets, and finally fades in appearing targets.
     */
    public AutoTransition() {
        init();
    }

    public AutoTransition(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    private void init() {
        setOrdering(ORDERING_SEQUENTIAL);
        addTransition(new Fade(Fade.OUT))
                .addTransition(new ChangeBounds())
                .addTransition(new Fade(Fade.IN));
    }

}

go on

public class TransitionSet extends Transition 

使用

TransitionManager.beginDelayedTransition(layout_test,AutoTransition().addTransition(Explode()))

你可能感兴趣的:(Transation)