From c53ce6d5cd9ea49128c4f6343371feebfef38a62 Mon Sep 17 00:00:00 2001
From: haijiang <181069201@qq.com>
Date: Wed, 06 Jun 2018 09:03:45 +0800
Subject: [PATCH] 提交
---
app/src/main/java/com/moral/yunfushao/ui/PanelView.java | 55 +++++++++++++++++++++++++++++--------------------------
1 files changed, 29 insertions(+), 26 deletions(-)
diff --git a/app/src/main/java/com/moral/yunfushao/ui/PanelView.java b/app/src/main/java/com/moral/yunfushao/ui/PanelView.java
index 785329a..edd75ff 100644
--- a/app/src/main/java/com/moral/yunfushao/ui/PanelView.java
+++ b/app/src/main/java/com/moral/yunfushao/ui/PanelView.java
@@ -28,7 +28,11 @@
private int mmHeight;
//���������������������������
private Paint mShaderPaint;
- private int[] mshaderColor = new int[]{Color.RED, Color.RED, Color.GREEN, Color.GREEN, Color.YELLOW, Color.YELLOW, Color.RED};
+ private int[] mshaderColor = new int[]{0xfff70e17,0xfff70e17,0xfff70e17,0xffff5c92,0xff00c44a,0xff00d062,0xff00f5af,0xff00f6cb,0xff00ccff,0xff179fff,0xffa054ff,0xffa53aff,0xffd74bff,0xfff64da5,0xfff70e17};
+ private int[] mshaderRedColor = new int[]{0xfff70e17,0xffff5c92};
+ private int[] mshaderZiseColor = new int[]{0xffa53aff,0xffd74bff,0xfff64da5};
+ private int[] mshaderBlueColor = new int[]{0xff00f6cb,0xff00ccff,0xff179fff,0xffa054ff};
+ private int[] mshaderGreenColor = new int[]{0xff00c44a,0xff00d062,0xff00f5af};
//������������������������
private SweepGradient mSweepGradient;
private int mShaderWidth = 70;
@@ -36,11 +40,11 @@
private Paint paintGapLine;
//������������������3�����������
- private int line1Color = 0xFFFAEAEB;
+ private int line1Color = 0xffb8e8f4;
//������������������15�����������
- private int line2Color = 0xFFFEB7B9;
+ private int line2Color = 0xff7ed3ff;
//������������������60�����������
- private int line3Color = 0xFFFF6C7E;
+ private int line3Color = 0xff009cff;
//������������
private int line1Length = 50;
//������������
@@ -55,16 +59,16 @@
private Paint drawTextPaint;
private int textColor = Color.GRAY;
private int textSize = 36;
- private String[] level = {"������","���������","���������","���������"};
+ private String[] level = {"������������","������������","������������","������������"};
//������������
private Paint mCirclePaint;
- private int innerCircleColor = 0xFFF6DFE1;
+ private int innerCircleColor = 0xffb8e8f4;
private int mCircleWidth = 70;
private int innerPadding = 20;
//���������
private Paint mProgressPaint;
- private int progressCircleColor = 0xFFFEB7B9;
+ private int progressCircleColor = 0xff53c9ff;
//���������
private Paint mBitPaint;
@@ -246,7 +250,7 @@
private void drawTextKedu(Canvas canvas){
for(int i=0;i<level.length;i++){
float textWidth = drawTextPaint.measureText(level[i]);
- if(percent<0.125){
+ if(percent<0.25){
if(i==0){
drawTextPaint.setColor(line3Color);
}else{
@@ -254,17 +258,17 @@
}
canvas.save();
if(i==0){
- canvas.rotate(-150,mWidth/2,mWidth/2);
- }else if(i==1){
canvas.rotate(-120,mWidth/2,mWidth/2);
+ }else if(i==1){
+ canvas.rotate(-45,mWidth/2,mWidth/2);
}else if(i==2){
- canvas.rotate(0,mWidth/2,mWidth/2);
+ canvas.rotate(45,mWidth/2,mWidth/2);
}else if(i==3){
canvas.rotate(120,mWidth/2,mWidth/2);
}
canvas.drawText(level[i],mWidth / 2-textWidth/2, paddingKedu+line2Length+textSize,drawTextPaint);
canvas.restore();
- }else if(percent>=0.125&&percent<0.4){
+ }else if(percent>=0.25&&percent<0.5){
if(i==1){
drawTextPaint.setColor(line3Color);
}else{
@@ -273,17 +277,17 @@
canvas.save();
// canvas.rotate(-120+i*75,mWidth/2,mWidth/2);
if(i==0){
- canvas.rotate(-150,mWidth/2,mWidth/2);
- }else if(i==1){
canvas.rotate(-120,mWidth/2,mWidth/2);
+ }else if(i==1){
+ canvas.rotate(-45,mWidth/2,mWidth/2);
}else if(i==2){
- canvas.rotate(0,mWidth/2,mWidth/2);
+ canvas.rotate(45,mWidth/2,mWidth/2);
}else if(i==3){
canvas.rotate(120,mWidth/2,mWidth/2);
}
canvas.drawText(level[i],mWidth / 2-textWidth/2, paddingKedu+line2Length+textSize,drawTextPaint);
canvas.restore();
- }else if(percent>=0.4&&percent<1.0){
+ }else if(percent>=0.5&&percent<0.75){
if(i==2){
drawTextPaint.setColor(line3Color);
}else{
@@ -292,17 +296,17 @@
canvas.save();
// canvas.rotate(-120+i*75,mWidth/2,mWidth/2);
if(i==0){
- canvas.rotate(-150,mWidth/2,mWidth/2);
- }else if(i==1){
canvas.rotate(-120,mWidth/2,mWidth/2);
+ }else if(i==1){
+ canvas.rotate(-45,mWidth/2,mWidth/2);
}else if(i==2){
- canvas.rotate(0,mWidth/2,mWidth/2);
+ canvas.rotate(45,mWidth/2,mWidth/2);
}else if(i==3){
canvas.rotate(120,mWidth/2,mWidth/2);
}
canvas.drawText(level[i],mWidth / 2-textWidth/2, paddingKedu+line2Length+textSize,drawTextPaint);
canvas.restore();
- }else if(percent>=1.0){
+ }else if(percent>=0.75){
if(i==3){
drawTextPaint.setColor(line3Color);
}else{
@@ -311,11 +315,11 @@
canvas.save();
// canvas.rotate(-105+i*75,mWidth/2,mWidth/2);
if(i==0){
- canvas.rotate(-150,mWidth/2,mWidth/2);
- }else if(i==1){
canvas.rotate(-120,mWidth/2,mWidth/2);
+ }else if(i==1){
+ canvas.rotate(-45,mWidth/2,mWidth/2);
}else if(i==2){
- canvas.rotate(0,mWidth/2,mWidth/2);
+ canvas.rotate(45,mWidth/2,mWidth/2);
}else if(i==3){
canvas.rotate(120,mWidth/2,mWidth/2);
}
@@ -332,11 +336,10 @@
private void drawJianbianCircle(Canvas canvas){
mSweepGradient = new SweepGradient(mWidth / 2, mWidth / 2, mshaderColor, null);
mShaderPaint.setShader(mSweepGradient);
- //145, 250
canvas.drawArc(new RectF(mShaderWidth + widthInner, mShaderWidth + widthInner, mWidth - mShaderWidth - widthInner, mWidth - mShaderWidth - widthInner), 120, 300, false, mShaderPaint);
//���������������
canvas.save();
- canvas.rotate(120, mWidth / 2, mWidth / 2);
+ canvas.rotate(75, mWidth / 2, mWidth / 2);
canvas.drawLine(mWidth / 2, line2Length + paddingKedu*3, mWidth / 2, (float) (line2Length + paddingKedu*0.65+mShaderWidth*2), paintGapLine);
canvas.restore();
canvas.save();
@@ -344,7 +347,7 @@
canvas.drawLine(mWidth / 2, line2Length + paddingKedu*3, mWidth / 2, (float) (line2Length + paddingKedu*0.65+mShaderWidth*2), paintGapLine);
canvas.restore();
canvas.save();
- canvas.rotate(-120, mWidth / 2, mWidth / 2);
+ canvas.rotate(-75, mWidth / 2, mWidth / 2);
canvas.drawLine(mWidth / 2, line2Length + paddingKedu*3, mWidth / 2, (float) (line2Length + paddingKedu*0.65+mShaderWidth*2), paintGapLine);
canvas.restore();
}
--
Gitblit v1.8.0