Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diogobernardino/CircularCounter
Android Widget
https://github.com/diogobernardino/CircularCounter
Last synced: about 6 hours ago
JSON representation
Android Widget
- Host: GitHub
- URL: https://github.com/diogobernardino/CircularCounter
- Owner: diogobernardino
- Created: 2014-05-10T13:26:05.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-27T20:52:29.000Z (about 10 years ago)
- Last Synced: 2023-11-07T15:19:14.771Z (about 1 year ago)
- Language: Java
- Size: 267 KB
- Stars: 253
- Watchers: 16
- Forks: 50
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-android-ui - https://github.com/diogobernardino/CircularCounter
- awesome-android-ui - https://github.com/diogobernardino/CircularCounter
README
Circular Counter
=============
Circular Counter is an Android Widget I needed to implement for an application I was developing. As it could be useful to more people, I tried to make it generic enough to share and be used by others.The view shows a value in the center together with 3 bars that grow depending on the values received. Digging into the code you can easily increase or decrease the number of bars.
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-CircularCounter-lightgrey.svg?style=flat)](https://android-arsenal.com/details/1/842)
Screenshot
----------------![Demo Screenshot][1]
Usage
--------Add ``CircularCounter`` widget to your layout. Configure the view customization elements using styleable attributes or/and programatically. This is a basic example, explore the code to get to know it in detail.
```xml
```
```java
//First Bar
counter.setFirstWidth(getResources().getDimension(R.dimen.first))
counter.setFirstColor(Color.parseColor(colors[0]))//Second Bar
counter.setSecondWidth(getResources().getDimension(R.dimen.second))
counter.setSecondColor(Color.parseColor(colors[1]))//Third Bar
counter.setThirdWidth(getResources().getDimension(R.dimen.third))
counter.setThirdColor(Color.parseColor(colors[2]))
counter.setBackgroundColor(Color.parseColor(colors[3]));```
To pass values to the view use ``setValues(value1, value2, value3)``. First value will be the one shown in text.
[1]: ./screenshot.png