RoundedHorizontalProgressBar - An Android custom rounded Progress Bar that supports different Colors as progress both primary & background colors. Allows you to animate the progress for a specific duration
dependencies {
...
compile 'com.sasank.roundedhorizontalprogress:roundedhorizontalprogress:1.0.1'
}
- In XML layout:
<com.sasank.roundedhorizontalprogress.RoundedHorizontalProgressBar
android:id="@+id/progress_bar_1"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:indeterminate="false"
android:maxHeight="12dp"
android:minHeight="12dp"
android:progress="40"
app:backgroundColor="@color/green_light"
app:progressColor="@color/green"/>
- If the progress Bar needs to be horizontal
<com.sasank.roundedhorizontalprogress.RoundedHorizontalProgressBar
android:id="@+id/progress_bar_1"
--------------------------------
app:backgroundColor="@color/green_light"
app:progressColor="@color/green"
app:isRounded="false"/>
- All customizable attributes of the View:
<declare-styleable name="RoundedHorizontalProgress">
<attr name="backgroundColor" format="color"/>
<attr name="progressColor" format="color"/>
<attr name="isRounded" format="boolean"/> <!-- Default Value is true(Rounded) -->
</declare-styleable>
- Animating the view progress
mRoundedHorizontalProgressBar.animateProgress(2000, 0, 80); // (animationDuration, oldProgress, newProgress)
- Clone the repository and check out the
app
module.