Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

light effect #20

wants to merge 3 commits into from

Conversation

mohsenjahani
Copy link

hi dear,

I just add a light effect to this component.

Copy link
Owner

@pkleczko pkleczko left a 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){
Copy link
Owner

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){
Copy link
Owner

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();
Copy link
Owner

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();
Copy link
Owner

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

}



Copy link
Owner

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants