CircleProgressBar

A circular android ProgressBar library which extends View, and the usage same as ProgressBar, It has solid,line and solid_line three styles. Besides, progress value can be freely customized.

Stars
1.3K

CircleProgressBar

CircleProgressBarView, . , . , LoadingDrawable.

Gradle

dependencies {
   compile 'com.dinuscxj:circleprogressbar:1.3.6'
}

xml:

<com.dinuscxj.progressbar.CircleProgressBar
	android:id="@+id/line_progress"
	android:layout_marginTop="@dimen/default_margin"
	android:layout_width="50dp"
	android:layout_height="50dp" />

:

The style:

  • line ()
  • solid_line
  • solid

The background color

  • background_color

The progress text:

  • text color
  • text size
  • visibility
  • format

The progress circle:

  • width
  • start degree
  • start color
  • end color
  • background color
  • draw background outside progress

The progress_shader

  • linear (start_colorend_colorshader)
  • radial
  • sweep

The progress blur (blur_radius0)

  • normal ()
  • solid
  • outer
  • inner

The progress stroke cap

  • butt ()
  • round
  • square

The line style:

  • width
  • count

:

<com.dinuscxj.progressbar.CircleProgressBar
	android:layout_width="50dp"
	android:layout_height="50dp"

	app:style="line"
	
	app:background_color="@color/holo_red_light"
	
	app:progress_text_color="@color/holo_purple"
	app:progress_text_size="@dimen/progress_text_size"

	app:progress_stroke_width="1dp"
	app:progress_start_color="@color/holo_purple"
	app:progress_end_color="@color/holo_green_light"
	app:progress_background_color="@color/holo_darker_gray"
	app:progress_start_degree="-90"
	app:drawBackgroundOutsideProgress="true"

	app:progress_shader="sweep"
    
	app:progress_stroke_cap="round"
	
	app:progress_blur_style="solid"
	app:progress_blur_radius="5dp"

	app:line_width="4dp"
	app:line_count="30"/>

progress

     private static final class MyProgressFormatter implements ProgressFormatter {
         private static final String DEFAULT_PATTERN = "%d%%";
 
         @Override
         public CharSequence format(int progress, int max) {
             return String.format(DEFAULT_PATTERN, (int) ((float) progress / (float) max * 100));
         }
     }
     
     // ProgressFormatter
     CircleProgressBar.setProgressFormatter(new MyProgressFromatter);
     // 
     CircleProgressBar.setProgressFormatter(null);
     

  1. View CircleProgressBar onSaveInstanceState onRestoreInstanceState(Parcelable state)
  2. String.format(),
  3. xml

android :) CircleProgressBarstar . ! _ QQ : 342748245

License

Copyright 2015-2019 dinuscxj

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.