Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/PhilJay/CircleDisplay
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilJay committed Jun 18, 2014
2 parents 40ea2a2 + 24910e7 commit ec62698
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,19 @@ or create it in code:
**Style** your <code>CircleDisplay</code>, and **show values**.

**Styling methods:**
- <code>setColor(int color)</code>: Use this method to set the color for the arc/bar that represents the value.
- <code>setColor(int color)</code>: Use this method to set the color for the arc/bar that represents the value. You can either use <code>Color.COLORNAME</code> as a parameter or <code>getColor(resid)</code>.
- <code>setStartAngle(float angle)</code>: Set the starting angle of your arc/bar. By default, it starts at the top of the view (270°).
- <code>setAnimDuration(int millis)</code>: Set the duration in milliseconds it takes to animate/build up the bar.
- <code>setTextSize(float size)</code>: Set the size of the text in the center of the view.
- <code>setValueWidthPercent(float percentFromTotalWidth)</code>: Set the width of the value bar/arc in percent of the circle radius.
- <code>setFormatDigits(int digits)</code>: Sets the number of digits to use for the value in the center of the view.
- <code>setDimAlpha(int alpha)</code>: Value between 0 and 255 indicating the alpha value used for the remainder of the value-arc.
- <code>setDrawText(boolean enabled)</code>: If enabled, center text (containing value and unit) is drawn.
- <code>setPaint(int which, Paint p)</code>: Sets a new <code>Paint</code> object instead of the default one. Use <code>CircleDisplay.PAINT_TEXT</code> for example to change the text paint used.
- <code>setUnit(String unit)</code>: Sets a unit that is displayed in the center of the view. E.g. "%" or "€" or whatever it is you want the circle-display to represent.

- <code>setStepSize(float stepsize)</code>: Sets the stepsize (minimum selection interval) of the circle display,
default 1f. It is recommended to make this value not higher than 1/5 of the maximum selectable value, and not lower than 1/200 of the maximum selectable value. For example, if a maximum of 100 has been chosen, a stepsize between 0.5 and 20 is recommended.
- <code>setCustomText(String[] custom)</code>: Sets an array of custom Strings to be drawn instead of the actual value in the center of the CircleDisplay. If set to null, the custom text will be reset and the value will be drawn. Make sure the length of the array corresponds with the maximum number of steps (maxvalue / stepsize).

**Showing stuff:**
- <code>public void showValue(float toShow, float total, boolean animated)</code>: Shows the given value. A maximumvalue also needs to be provided. Set animated to true to animate the displaying of the value.
Expand All @@ -74,5 +77,7 @@ or create it in code:
cd.setTouchEnabled(true);
cd.setSelectionListener(this);
cd.setUnit("%");
cd.setStepSize(0.5f);
// cd.setCustomText(...); // sets a custom array of text
cd.showValue(75f, 100f, true);
```

0 comments on commit ec62698

Please sign in to comment.