ViewCompat.animate的用法和点击萎缩动画效果

ViewCompat.animate(v)
        .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的用法和点击萎缩动画效果)