CircularProgressBar
lopspower
700
Visit GitHub RepoProgress Indicators

CircularProgressBar

sample

License Platform API
Android Arsenal Twitter

This is an Android project allowing to realize a circular ProgressBar in the simplest way possible.

Android app on Google Play

USAGE

To make a circular ProgressBar add CircularProgressBar in your layout XML and add CircularProgressBar library in your project or you can also grab it via Gradle:

implementation 'com.mikhaellopez:circularprogressbar:2.0.0'

XML

<com.mikhaellopez.circularprogressbar.CircularProgressBar
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:cpb_background_progressbar_color="#FFCDD2"
    app:cpb_background_progressbar_width="5dp"
    app:cpb_progressbar_color="#F44336"
    app:cpb_progressbar_width="10dp" />

You must use the following properties in your XML to change your CircularProgressBar.

Properties:
  • app:cpb_progress (integer) -> default 0
  • app:cpb_progress_max (integer) -> default 100
  • app:cpb_indeterminate_mode (boolean) -> default false
  • app:cpb_progressbar_color (color) -> default BLACK
  • app:cpb_background_progressbar_color (color) -> default GRAY
  • app:cpb_progressbar_width (dimension) -> default 7dp
  • app:cpb_background_progressbar_width (dimension) -> default 3dp

JAVA

CircularProgressBar circularProgressBar = (CircularProgressBar)findViewById(R.id.yourCircularProgressbar);
circularProgressBar.setColor(ContextCompat.getColor(this, R.color.progressBarColor));
circularProgressBar.setBackgroundColor(ContextCompat.getColor(this, R.color.backgroundProgressBarColor));
circularProgressBar.setProgressBarWidth(getResources().getDimension(R.dimen.progressBarWidth));
circularProgressBar.setBackgroundProgressBarWidth(getResources().getDimension(R.dimen.backgroundProgressBarWidth));
int animationDuration = 2500; // 2500ms = 2,5s
circularProgressBar.setProgressWithAnimation(65, animationDuration); // Default duration = 1500ms

LICENCE

CircularProgressBar by Lopez Mikhael is licensed under a Apache License 2.0. Based on a work at https://github.com/Pedramrn/CircularProgressBar.

Become a better Android Developer
Millions of developers are learning at MindOrks

Online Training Program

Featured Blogs

Our Team

MindOrks is Certainly one of the best online blog to stay on top of all the Android development news, coding and design patterns. Finally a blog I can count on to keep myself updated with latest and greatest things happening in Android world.

Vipul Shah
Android Developer
Microsoft

Become Pro in Android by watching videos

OUR LEARNERS WORK AT