A simple circle progress view.
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
//...
maven { url 'https://jitpack.io' }
}
}
Add it in your app build.gradle at the end of repositories:
dependencies {
implementation 'com.github.samlss:CircleProgressView:1.0'
}
attr | description |
---|---|
circleColor | set color of the circle |
progress | set progress(0-100) |
progressColor | set color of the progress rotating bar |
progressTextColor | set the color of progress text |
progressTextSize | set the size of progress text |
<com.iigo.library.CircleProgressView
android:id="@+id/cpv_progress"
android:layout_centerInParent="true"
app:progress="50"
app:progressTextSize="10dp"
app:progressColor="@android:color/white"
app:circleColor="#2968F7"
app:progressTextColor="@android:color/white"
android:layout_width="60dp"
android:layout_height="60dp" />
circleProgressView.setProgress(int progress); //set the progress, the range is 0-100
circleProgressView.setProgressColor(Color.RED); //set color of the progress rotating bar
circleProgressView.setProgressTextColor(Color.RED); // set the color of progress text
circleProgressView.setProgressTextSize(20); // set the size of progress text