Circular Progress View
An easy to use, and highly customisable progress view, that is circular for Android!
Last updated
Was this helpful?
An easy to use, and highly customisable progress view, that is circular for Android!
Last updated
Was this helpful?
Add the library to the dependencies { ... } section of your app level build.gradle
file:
Add the view to your xml layout file.
XML Attributes
Description
Data Type
Possible Values
Default Value
Is Required?
progressType
Determinate indicators display how long a process will take. They should be used when the process completion rate can be detected.
Indeterminate indicators express an unspecified amount of wait time. They should be used when progress isn’t detectable, or if it’s not necessary to indicate how long an activity will take.
enum
determinate
indeterminate
indeterminate
NO
progressStrokeColor
the color of the progress stroke indicator
color
n/a
#000000 (black)
NO
backgroundColor
the color between the stroke indicator
color
n/a
#FF000000 (transparent)
NO
borderColor
a light color used to highlight the stroke indicator path
color
n/a
#FF000000 (transparent)
NO
determinateProgressValue
sets the current progress value based on the provided maxDeterminateProgressValue*
float
n/a
n/a
NO
determinateProgressValuePercentage
sets the current progress value by percentage based on the provided maxDeterminateProgressValue*
float
n/a
n/a
NO
maxDeterminateProgressValue*
the maximum value of the progress indicator. Corresponds to 100%.
float
n/a
n/a
YES*
progressStrokePlacement
sets where the stroke indicator should be placed.
enum
outside
inside
center
inside
NO
* It is required when you set either determinateProgressValue
or determinateProgressValuePercentage
.
Return type
Method & Description
boolean
isIndeterminate()
Returns whether the progress type is ProgressType.INDETERMINATE
void
setBackgroundColor(int colorInt)
Changes the current backgroundColor to the specified one.
void
setBorderColor(int colorInt)
Changes the current borderColor to the specified one.
void
setProgressStrokeColor(int colorInt)
Change the stroke color of the progress.
void
setStrokePlacement(StrokePlacement strokePlacement)
Change the stroke position to be either StrokePlacement.OUTSIDE, StrokePlacement.INSIDE or StrokePlacement.CENTER.
void
setProgressType(ProgressType progressType)
Change the progress type to be either ProgressType.DETERMINATE, ProgressType.INDETERMINATE.
void
pauseIndeterminateAnimation(boolean hideStroke)
Pauses the indeterminate stroke animation to the current position. If hideStroke is true it will hide the stroke automatically when paused.
resumeIndeterminateAnimation()
Resumes the paused indeterminate stroke animation.
toggleIndeterminateAnimation()
Toggles the indeterminate animation.
void
pauseIndeterminateAnimation()
Resumes the paused indeterminate stroke animation.
void
setRange(int maximumProgressValue)
Sets the maximum allowed progress value. Should be > 0
void
setProgress(float progressPercentage, boolean animated)
Sets the current progress value by the percentage. If animated is true it will animate the progress change.
setProgress(float progressPercentage)
Sets the current progress value by the percentage, without animating the change.
💡 Use this static method(float) calcProgressValuePercentageOf(int value, int maxValue)
to get the progressPercentage.