CircularProgressView

Additional

Language
Java
Version
N/A
Created
May 10, 2015
Updated
Nov 26, 2017 (Retired)
Owner
Nomad5 (nomad5modules)
Contributor
Martin Mlostek (mlostekk)
1
Activity
Badge
Generate
Download
Source code

CircularProgressView

A circular progressview for android

About

This is a simple small class that renders a progress in form of an filling arc shape. A progress text can be rendered additionally. This text is rendered in the secondary color for the 'done' area of the arc.

I used it for rendering the progress that is done in the background of all views. This view has no dependencies.

It also supports a custom font (that is places in the 'assets' directory) and fading of the progress view (even though I recommend setting the 'fadeTime' value to -1 and use a Fragment with a FragmentTransation to fade this view in and out).

All values are optional. If you want to reuse the view from the code, simply set the class members in the CircularProgressView class accordingly.

XML Attributes

Following XML attributes are allowed

<momentum.circularprogressview.CircularProgressView
 progressColor=  "#FFFFFF"
 progressText=  "TEST PROGRESS  #VAL#"
 progressTextFont= "consolab.ttf"
 progressTextSize= "36"
 borderOffset=  "150"
 fadeTimeMs=   "500" />

progressColor:

The main color of the progress ARC. The text will be rendered in this color where the arc is not yet painted.

progressText:

The Text to be rendered. Add #VAL# to the text in order to automatically add a interger value to the progress text.

progressTextFont:

An optional ttf or otf font. This font hast to be in the "assets" directory.

progressTextSize:

The font size

borderOffset:

Optional border offset, next iteration will kick this, its just a fix to fill the corners (will be deprecated in next version)

fadeTimeMs:

The fade in and fade out time, can be set to -1 to ignore fading

Example Application

Gradle include from jCenter

You can add it also via

// The dependencies
dependencies {
    /* the circular progress view */
    compile 'com.nomad5:circularprogressview:1.3.3'
}

This works with jCenter and mavenCentral.

Additional information

  • Set the progress to 0 (at the beginning) and 1 (at the end).
  • 'wrapcontent' for dimensions is not yet supported
  • Call setProgress with additional interpolation time (in ms) in order to interpolate between progress values

License

Check file LICENSE and Make sure to follow the licensing terms and conditions of the project and the software used to build the project.

Feedback

If you have any questions or feedback, feel free to get back to me!

Next Todo's

  • nothing on the list. Any suggestions?