车辆车长规则优化
This commit is contained in:
@@ -66,7 +66,7 @@ public class CircleBarView2 extends View {
|
||||
|
||||
public CircleBarView2(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initAttrs(context,attrs);
|
||||
initAttrs(context, attrs);
|
||||
}
|
||||
|
||||
public int getMax() {
|
||||
@@ -82,7 +82,7 @@ public class CircleBarView2 extends View {
|
||||
}
|
||||
|
||||
public void setProgress(int progress) {
|
||||
if (this.progress == progress) {
|
||||
if (progress != 0 && this.progress == progress) {
|
||||
return;
|
||||
}
|
||||
if (animator != null && animator.isRunning()) {
|
||||
@@ -158,7 +158,7 @@ public class CircleBarView2 extends View {
|
||||
innerPaint.setColor(context.getColor(R.color.color_f15));
|
||||
innerPaint.setStyle(Paint.Style.STROKE);
|
||||
innerPaint.setStrokeCap(Paint.Cap.ROUND);
|
||||
innerPaint.setStrokeWidth(roundWidth+10);
|
||||
innerPaint.setStrokeWidth(roundWidth + 10);
|
||||
|
||||
mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
mTextPaint.setColor(context.getColor(R.color.color_9));
|
||||
@@ -206,7 +206,7 @@ public class CircleBarView2 extends View {
|
||||
// 中心点
|
||||
centerPoint.set(getWidth() / 2, height / 2);
|
||||
// 计算圆弧显示的范围,height * 2 是因为圆弧的高度是根据园来算的,所以双倍才是半个圆
|
||||
oval.set(getWidth() / 2f - radius, (float) roundWidth, getWidth() / 2f + radius, height * 2 - roundWidth*2);
|
||||
oval.set(getWidth() / 2f - radius, (float) roundWidth, getWidth() / 2f + radius, height * 2 - roundWidth * 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user