##Android NumberProgressBar
This repository is a fork of original daimajia/NumberProgressBar
###Demo
Project build.gradle
allprojects {
repositories {
maven { url "http://dl.bintray.com/dona278/maven/" }
}
}
Module build.gradle
dependencies {
compile "com.dona278.numberprogressbar:library:1.0@aar"
}
Use it in your own code:
<com.dona278.numberprogressbar.NumberProgressBar
android:id="@+id/number_progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
I made some predesign style. You can use them via style
property.
Use the preset style just like below:
<com.dona278.numberprogressbar.NumberProgressBar
android:id="@+id/number_progress_bar"
style="@style/NumberProgressBar_Default" />
In the above picture, the style is :
NumberProgressBar_Default
NumberProgressBar_Passing_Green
NumberProgressBar_Relax_Blue
NumberProgressBar_Grace_Yellow
NumberProgressBar_Warning_Red
NumberProgressBar_Funny_Orange
NumberProgressBar_Beauty_Red
NumberProgressBar_Twinkle_Night
You can get more beautiful color from kular, and you can also contribute your color style to NumberProgressBar!
###Attributes
There are several attributes you can set:
The reached area and unreached area:
- color
- height
The text area:
- color
- text size
- visibility
- distance between reached area and unreached area
The bar:
- max progress
- current progress
- custom value
- suffix
- prefix
for example, the default style:
<com.dona278.numberprogressbar.NumberProgressBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
custom:numberProgressBarUnreachedColor="#CCCCCC"
custom:numberProgressBarReachedColor="#3498DB"
custom:numberProgressBarUnreachedBarHeight="0.75dp"
custom:numberProgressBarReachedBarHeight="1.5dp"
custom:numberProgressBarTextSize="10sp"
custom:numberProgressBarTextColor="#3498DB"
custom:numberProgressBarTextOffset="1dp"
custom:numberProgressBarTextVisibility="visible"
custom:numberProgressBarMax="100"
custom:numberProgressBarCurrent="75"
custom:numberProgressBarCustomValue="4"
custom:numberProgressBarPrefix="Is "
custom:numberProgressBarSuffix="th step"/>