一个录屏软件;licecap
public void onClick(View v) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
/*
* 前一个200,表示X轴上的坐标;后一个表示Y轴上的坐标
* 5表示动画开始时的半径;200表示结束时的半径
* */
Animator animation = ViewAnimationUtils.createCircularReveal(view, 200, 200, 5, 300);
animation.setDuration(3000);
animation.start();
animation.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
view.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
} else {
Toast.makeText(getApplicationContext(), "4.+系统", Toast.LENGTH_LONG).show();
}
}
});
注意:
如果你是在根布局加载的这个动画,呢么需要在onReume方法中给根布局view注册onLayoutChange的方法,在这个方法的回调中实现对动画的处理
@Override
protected void onResume() {
super.onResume();
activity_creat_event.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
v.removeOnLayoutChangeListener(this);
startAni();
}
});
}