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

Support customization of line thickness #1

Open
vinaygopinath opened this issue Jun 10, 2018 · 0 comments
Open

Support customization of line thickness #1

vinaygopinath opened this issue Jun 10, 2018 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@vinaygopinath
Copy link
Owner

vinaygopinath commented Jun 10, 2018

The thickness of the "completed" line (line leading to a completed step) and "not-completed" line (line leading to a not-completed step or the current step) is currently hardcoded in StepViewIndicator using setStrokeWidth.

    mNotCompletedLinePaint = new Paint();
    mCompletedLinePaint = new Paint();
    mNotCompletedLinePaint.setAntiAlias(true);
    mNotCompletedLinePaint.setColor(mNotCompletedLineColor);
    mNotCompletedLinePaint.setStyle(Paint.Style.STROKE);
    mNotCompletedLinePaint.setStrokeWidth(2);

    mCompletedLinePaint.setAntiAlias(true);
    mCompletedLinePaint.setColor(mCompletedLineColor);
    mCompletedLinePaint.setStyle(Paint.Style.STROKE);
    mCompletedLinePaint.setStrokeWidth(2);

Allowing the user to customize the stroke width of the completed and not-completed lines would be a nice enhancement.

What's required

  1. Create new integer fields in StepViewIndicator: mCompletedLineThickness and mNotCompletedLineThickness, both of which should default to 2 (current thickness)
  2. Create getters and setters for the new fields (Refer the getters and setters for circle radius and line length)
  3. Expose the getters and setters on StepViewIndicator via StepView, which should simply call the methods on StepViewIndicator (Refer to the getters and setters for circle radius and line length in StepView)
  4. Update the code copy-pasted above to use the new mCompletedLineThickness and mNotCompletedLineThickness
mNotCompletedLinePaint.setStrokeWidth(mNotCompletedLineThickness);
..
mCompletedLinePaint.setStrokeWidth(mCompletedLineThickness);

Please assign yourself and/or leave a comment if you decide to tackle this issue.

@vinaygopinath vinaygopinath added enhancement New feature or request good first issue Good for newcomers labels Jun 10, 2018
@vinaygopinath vinaygopinath added this to the 2.1 milestone Jun 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant