inspired from https://github.com/daimajia/NumberProgressBar
and CleanMaster
Demo download link
please use jitpack
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
dependencies {
compile 'com.github.lzyzsd:circleprogress:1.2.1'
}
please always use same width and height for progress views
DonutProgress
<com.github.lzyzsd.circleprogress.DonutProgress
android:layout_marginLeft="50dp"
android:id="@+id/donut_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
custom:donut_progress="30"/>
attrs for DonutProgress
<declare-styleable name="DonutProgress">
<attr name="donut_progress" format="integer"/>
<attr name="donut_max" format="integer"/>
<attr name="donut_unfinished_color" format="color"/>
<attr name="donut_finished_color" format="color"/>
<attr name="donut_finished_stroke_width" format="dimension"/>
<attr name="donut_unfinished_stroke_width" format="dimension"/>
<attr name="donut_text_size" format="dimension"/>
<attr name="donut_text_color" format="color"/>
<attr name="donut_text" format="string"/>
<attr name="donut_prefix_text" format="string"/>
<attr name="donut_suffix_text" format="string"/>
<attr name="donut_background_color" format="color"/>
</declare-styleable>
CircleProgress
<com.github.lzyzsd.circleprogress.CircleProgress
android:id="@+id/circle_progress"
android:layout_marginLeft="50dp"
android:layout_width="100dp"
android:layout_height="100dp"
custom:circle_progress="20"/>
attrs for CircleProgress
<declare-styleable name="CircleProgress">
<attr name="circle_progress" format="integer"/>
<attr name="circle_max" format="integer"/>
<attr name="circle_unfinished_color" format="color"/>
<attr name="circle_finished_color" format="color"/>
<attr name="circle_text_size" format="dimension"/>
<attr name="circle_text_color" format="color"/>
<attr name="circle_prefix_text" format="string"/>
<attr name="circle_suffix_text" format="string"/>
</declare-styleable>
ArcProgress
<com.github.lzyzsd.circleprogress.ArcProgress
android:id="@+id/arc_progress"
android:background="#214193"
android:layout_marginLeft="50dp"
android:layout_width="100dp"
android:layout_height="100dp"
custom:arc_progress="55"
custom:arc_bottom_text="MEMORY"/>
attrs for ArchProgress
<declare-styleable name="ArcProgress">
<attr name="arc_progress" format="integer"/>
<attr name="arc_angle" format="float"/>
<attr name="arc_stroke_width" format="dimension"/>
<attr name="arc_max" format="integer"/>
<attr name="arc_unfinished_color" format="color"/>
<attr name="arc_finished_color" format="color"/>
<attr name="arc_text_size" format="dimension"/>
<attr name="arc_text_color" format="color"/>
<attr name="arc_suffix_text" format="string"/>
<attr name="arc_suffix_text_size" format="dimension"/>
<attr name="arc_suffix_text_padding" format="dimension"/>
<attr name="arc_bottom_text" format="string"/>
<attr name="arc_bottom_text_size" format="dimension"/>
</declare-styleable>
donut_inner_drawable
support add a drawable to the center
donut_show_text
show or hide bottom text
run ./gradlew assembleDebug
(Mac/Linux)
or
run gradlew.bat assembleDebug
(Windows)
version 1.1.0: add bottom text to DonutProgressView
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004
Copyright (C) 2014 Bruce Lee <bruceinpeking#gmail.com>
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- You just DO WHAT THE FUCK YOU WANT TO.