TextView textView = (TextView)findViewById(R.id.textView); ImageView imageView1 = (ImageView) findViewById(R.id.imageView1); ImageView imageView2 = (ImageView) findViewById(R.id.imageView2); textView.setOnClickListener(viewOnClickListener); imageView1.setOnClickListener(viewOnClickListener); imageView2.setOnClickListener(viewOnClickListener); /* Animator createCircularReveal(View view, int centerX, int centerY, float startRadius, float endRadius) */ View.OnClickListener viewOnClickListener = new View.OnClickListener(){ @Override public void onClick(View v) { Animator animatorCircularReveal = ViewAnimationUtils.createCircularReveal( v, 0, 0, 0, (float) Math.hypot(v.getWidth(), v.getHeight())); animatorCircularReveal.setInterpolator(new AccelerateDecelerateInterpolator()); animatorCircularReveal.start(); } };
核心代码
时间: 2024-10-27 11:29:03