Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lalongooo/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.
https://github.com/lalongooo/rings
android chart
Last synced: 9 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/lalongooo/rings
- Owner: lalongooo
- License: apache-2.0
- Created: 2018-03-19T00:04:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-13T21:58:23.000Z (over 4 years ago)
- Last Synced: 2024-10-07T09:36:41.894Z (about 1 month ago)
- Topics: android, chart
- Language: Java
- Homepage:
- Size: 2.92 MB
- Stars: 165
- Watchers: 8
- Forks: 21
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-list - lalongooo/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. (Java)
README
[![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-Rings-green.svg?style=flat )]( https://android-arsenal.com/details/1/6871 )
# 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.![Rings Demo](https://i.imgur.com/Khwxkyi.png)
# Setup
## 1. Provide the gradle dependencyAdd 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.``` xml
```
## 3. Add the custom attributes as needed
Text size. Default is `18sp`.
``` xml
app:rings_text_size
```Margin left of the text. Default is `10dp`.
``` xml
app:rings_text_margin_left
```The three inner rings stroke width. Default is `8dp`.
``` xml
app:rings_inner_stroke_width
```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`.
``` xml
app:rings_inner_stroke_width_unfinished
```The outer ring stroke width. Default is `12dp`.
``` xml
app:rings_outer_stroke_width
```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`.
``` xml
app:rings_outer_stroke_width_unfinished
```Default unfinished/incomplete background color for all rings.
``` xml
app:rings_unfinished_color
```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.
``` xml
app:rings_default_filled_color
```Finished/progress color of the first inner ring.
``` xml
app:rings_inner_first_color
```Finished/progress color of the second inner ring.
``` xml
app:rings_inner_second_color
```Finished/progress color of the third inner ring.
``` xml
app:rings_inner_third_color
```Finished/progress color of the outer ring.
``` xml
app:rings_overall_color
```Progress of the first inner ring. Between 0 and 100. Default is 0.
``` xml
app:rings_inner_first_progress
```Progress of the second inner ring. Between 0 and 100. Default is 0.
``` xml
app:rings_inner_second_progress
```Progress of the third inner ring. Between 0 and 100. Default is 0.
``` xml
app:rings_inner_third_progress
```Progress of the outer ring. Between 0 and 100. Default is 0.
``` xml
app:rings_overall_progress
```Text of the first inner ring.
``` xml
app:rings_inner_first_text
```Text of the second inner ring.
``` xml
app:rings_inner_second_text
```Text of the third inner ring.
``` xml
app:rings_inner_third_text
```Text of the outer ring.
``` xml
app:rings_overall_text
```## Example
``` xml
```
### Result
![Rings Example](https://i.imgur.com/BoP3tIy.png)