repositories {
17 | jcenter()
18 | }
19 |
20 | dependencies {
21 | compile 'pl.pawelkleczkowski.customgauge:CustomGauge:1.0.4'
22 | }
23 | * Add "pl.pawelkleczkowski.customgauge.CustomGauge" view in your layout (example below)
24 | * Find CustomGauge view in your activity and use methods "setValue()" and "getValue()" to manage view
25 |
26 | ### Attributes
27 |
28 | Available view attributes:
29 |
30 | * startAngel (left start angel in degrees) - please be informed that gauge is drawn as an arc from startAngel (where to start) with sweepAngel (how many degrees arc is); what is more it's clockwise (right - 0, bottom - 90, left - 180, top - 270 degrees); if for example you want full circle start on 90 with 360 sweepAngel
31 | * sweepAngel - as described above
32 | * startValue - scale start value
33 | * endValue - scale end value
34 | * strokeWidth - stroke width
35 | * strokeColor - resource color (cannot be selector)
36 | * strokeCap - style of circle stroke (BUTT - straight, ROUND - rounded)
37 | * pointSize - defined for pointer drawn on current value (first example) - tells how wide pointer should be; if not set pointer is drawn from start value to current value (like second example)
38 | * pointStartColor - used for gradient pointer (second example)
39 | * pointEndColor - used for gradient pointer (second example)
40 | * dividerSize - size of divider related to values; if declared dividers will be drawn(!); e.g. if your start value is 50 and end value is 120 dividerSize set to 2 means that divider will have 1/35 of gauge total width - in other words it will have size of 2 points of gauge scale
41 | * dividerStep - tells how often dividers will be drawn; it's in percentage values(!); e.g. if you want to have dividers drawn each 20% of scale just set it to 20 and you will have 6 dividers drawn (with first and last)
42 | * dividerColor - color of divider
43 | * dividerDrawFirst - whether to draw first divider or no
44 | * dividerDrawLast - whether to draw last divider or no
45 |
46 |
47 |
48 | ### Example
49 |
50 |
51 |