-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
light effect #20
base: master
Are you sure you want to change the base?
light effect #20
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my comments.
And thanks for contribution :)
@@ -104,6 +111,13 @@ else if (mStrokeCap.equals("ROUND")) | |||
mPoint = mStartAngle; | |||
} | |||
|
|||
public void setLightEffect(boolean mLightEffect) { | |||
this.mLightEffectActive = mLightEffect; | |||
if(mLightEffect){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please reformat code (missing space here)
@@ -127,7 +141,13 @@ protected void onDraw(Canvas canvas) { | |||
mPaint.setShader(null); | |||
canvas.drawArc(mRect, mStartAngle, mSweepAngle, false, mPaint); | |||
mPaint.setColor(mPointStartColor); | |||
mPaint.setShader(new LinearGradient(getWidth(), getHeight(), 0, 0, mPointEndColor, mPointStartColor, Shader.TileMode.CLAMP)); | |||
|
|||
if(mLightEffectActive){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please reformat code (missing space here)
@@ -153,6 +173,7 @@ protected void onDraw(Canvas canvas) { | |||
} | |||
} | |||
|
|||
if(mLightEffectActive) invalidate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please reformat code (missing space here); use braces for if conditions, even if its only one instruction, move it to new line
private float mLightPosition = 0; | ||
private float mLightMoveSpeed = .5f; | ||
private List<Integer> mColorsRangeList = new ArrayList<>(); | ||
// private Matrix matrix = new Matrix(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comments if not necessary
} | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove additional new lines
@@ -1,93 +1,11 @@ | |||
CustomGauge | |||
CustomGauge with light effect animation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please just add new section about light effect animation at the bottom of README instead of removing its content and renaming lib
hi dear,
I just add a light effect to this component.