首页 > 代码库 > ViewCompat.animate(view) 动画的操作

ViewCompat.animate(view) 动画的操作

 


ViewCompat.animate(view)

实现动画的操作,动画兼容包;

ViewCompat.animate(view) 实现动画的操作
        .setDuration(200)
        .scaleX(0.9f)
        .scaleY(0.9f)
        .setInterpolator(new CycleInterpolator())
        .setListener(new ViewPropertyAnimatorListener() {
            @Override
            public void onAnimationStart(final View view) {

            }

            @Override
            public void onAnimationEnd(final View view) {
                switch (v.getId()) {
                    case R.id.btn_horizontal_ntb:
                        startActivity(
                                new Intent(MainActivity.this, HorizontalNtbActivity.class)
                        );
                        break;
                    case R.id.btn_horizontal_top_ntb:
                        startActivity(
                                new Intent(MainActivity.this, TopHorizontalNtbActivity.class)
                        );
                        break;
                    case R.id.btn_vertical_ntb:
                        startActivity(
                                new Intent(MainActivity.this, VerticalNtbActivity.class)
                        );
                        break;
                    case R.id.btn_samples_ntb:
                        startActivity(
                                new Intent(MainActivity.this, SamplesNtbActivity.class)
                        );
                        break;
                }
            }

            @Override
            public void onAnimationCancel(final View view) {

            }
        })
        .withLayer()
        .start();



ViewCompat.animate(view) 动画的操作