0
我想修改一點點這個庫:https://github.com/Shinelw/ColorArcProgressBar如何將位圖與Circle ProgressBar一起旋轉?
而且這是我到目前爲止已經完成,沒有紫色圓形指示燈: arc progress bar
我的問題是:我怎麼能動畫紫色圓圈和進度(如圖所示)?
擴展視圖,在的onDraw方法裏面ColorArcProgressBar類,這是進步的是如何得出:canvas.drawArc(bgRect, startAngle, currentAngle, false, progressPaint);
和動畫
private void setAnimation(float last, float current, int length) {
progressAnimator = ValueAnimator.ofFloat(last, current);
progressAnimator.setDuration(length);
progressAnimator.setTarget(currentAngle);
progressAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
currentAngle = (float) animation.getAnimatedValue();
curValues = currentAngle/k;
}
});
progressAnimator.start();
}
我設法紫色bitmat在起始位置這樣的進展:
canvas.drawBitmap(mIcon,bgRect.left+mIcon.getWidth()/2 +30, bgRect.bottom - 40 +mIcon.getHeight()/2 , null);
現在,我怎樣才能像沿着圓弧進行動畫?
它完美的工作!非常感謝! – JuLes
我嘗試了一些東西,但現在我發現我忘了我們需要工作與罪惡和罪惡,我的X和Y是一樣的,但沒有COS和罪惡。 – JuLes