Android Rings
A simple chart for Android with three indicators and one more to indicate overall summary. They get highlighted if you click on the ring or text.
Setup
1. Provide the gradle dependency
Add the gradle dependency to your app
module build.gradle
file:
dependencies {
compile 'com.lalongooo:rings:1.0.0'
}
2. Add the Rings
custom view to your layout xml file
Make sure layout_width
and layout_height
are equal so rings can be a perfect circle inside a square, otherwise
it'd look like an ellipse inside a rectangle.
3. Add the custom attributes as needed
Text size. Default is 18sp
.
Margin left of the text. Default is 10dp
.
The three inner rings stroke width. Default is 8dp
.
The three inner rings stroke width when unfinished or incomplete, if value is the same as app:rings_inner_stroke_width
, it will be invisible. Default is 10dp
.
The outer ring stroke width. Default is 12dp
.
The outer ring stroke width when unfinished or incomplete, if value is the same as app:rings_outer_stroke_width_unfinished
, it will be inviisble. Default is 12dp
.
Default unfinished/incomplete background color for all rings.
Default finished/progress color for all the inner rings. It is overriden by app:rings_inner_first_color
, app:rings_inner_second_color
, app:rings_inner_third_color
when specified.
Finished/progress color of the first inner ring.
Finished/progress color of the second inner ring.
Finished/progress color of the third inner ring.
Finished/progress color of the outer ring.
Progress of the first inner ring. Between 0 and 100. Default is 0.
Progress of the second inner ring. Between 0 and 100. Default is 0.
Progress of the third inner ring. Between 0 and 100. Default is 0.
Progress of the outer ring. Between 0 and 100. Default is 0.
Text of the first inner ring.
Text of the second inner ring.
Text of the third inner ring.
Text of the outer ring.