RippleView.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:Garbage_RippleView 作者:
private void init() {
    setLayerType(LAYER_TYPE_SOFTWARE,null);
    mPaint = new Paint();
    mPaint.setStyle(Paint.Style.FILL);
    mPaint.setStrokeWidth(1);
    mPaint.setAntiAlias(true);
    mPaint.setColor(Color.RED);

    mPath = new Path();


    anim = ValueAnimator.ofFloat(0f,1f);
    anim.setInterpolator(new AccelerateInterpolator());
    anim.setDuration(5000);
    anim.setRepeatCount(ValueAnimator.INFINITE);
    anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            progress = (float)animation.getAnimatedValue();
            invalidate();
        }
    });

    anim.start();

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号