中间的圆圈如果想添加旋转效果该怎么做?
drawable没法旋转,得用bitmap
Matrix matrix = new Matrix();
matrix.setRotate(-360 *mmProgress,baseBitmap.getWidth()/2,baseBitmap.getHeight()/2);//步骤2
System.out.println("TouchPullViewc:"+360 *mProgress );
matrix.postTranslate(mCirclePointX-baseBitmap.getWidth()/2,mCirclePointY-baseBitmap.getHeight()/2);//步骤3 屏幕的中心点
canvas.drawBitmap(baseBitmap, matrix, null);//步骤4
Drawable drawable=mContent;
if (drawable!=null){
canvas.save();
//剪切矩形区域
canvas.clipRect(drawable.getBounds());
canvas.rotate(mRotate,mCirclePointX,mCirclePointY);
drawable.draw(canvas);
}
canvas的rotate(float,float,float)方法是旋转画布
第一个参数:旋转角度(0~无穷)
第二个参数:旋转中心点x坐标
第三个参数:旋转中心点y坐标