CircularProgressDrawable Documentation

repository·master·Indexed 21 days ago

https://github.com/sefford/circularprogressdrawable

An Android drawable for indicating progress through visual rings, consisting of an inner circle, outline ring, and outer ring. It supports Progress and Indetermination modes and is designed for easy animation and integration as a drawable rather than a full View subclass.

Tokens
567
Snippets
2
Records
4
Agent score
24%

What's inside CircularProgressDrawable

  1. How CircularProgressDrawable is composed

    master

    The CircularProgressDrawable is composed of three distinct visual layers:

    1. Inner Circle: The central part of the drawable. Its radius can be scaled to create progress effects or to act as a background for a TextView.
    2. Outline Ring: A ring surrounding the inner circle that serves as a subtle cue for the empty state of the progress.
    3. Outer Ring: Used to indicate progress. In the current version, the progress ring is filled from the bottom and moves counter-clockwise.
  2. Configure CircularProgressDrawable modes and properties

    master

    The drawable can be defined programmatically. The primary configuration requirements are the colors and the size of the outer ring.

    Modes

    • Progress Mode: Fills the outer ring to show a specific progress level.
    • Indetermination Mode: Instead of filling the ring, a 90º arc is shown which can be animated to spin around the inner circle.

    Key Properties

    • Scale Property: The scale of the inner ring can be manipulated to create effects like pulsating, overshoot, or making the inner circle disappear entirely.
  3. Install CircularProgressDrawable via Maven or Gradle

    master

    You can integrate CircularProgressDrawable into your Android project using Maven or Gradle. Note that the library is distributed in .aar format.

    Maven

    Add the following dependency to your pom.xml:

    Gradle

    Add the following line to your build.gradle dependencies block:

    <dependency>
        <groupId>com.sefford</groupId>
        <artifactId>circular-progress-drawable</artifactId>
        <version>1.31</version>
        <type>aar</type>
    </dependency>
    compile 'com.sefford:circular-progress-drawable:1.31@aar'
  4. Configure Proguard for CircularProgressDrawable animations

    master

    If you use Android Animators and your application is obfuscated with Proguard, animations may stop working. To prevent this, add the following rule to your proguard.conf file to keep the class members of CircularProgressDrawable:

    -keepclassmembers class com.sefford.circularprogressdrawable.CircularProgressDrawable { *;}