Circular Progress Button

repository·master·Indexed 27 days ago

https://github.com/dmytrodanylyk/circular-progress-button

An Android library providing a button component that morphs into a circular progress indicator. Includes CircularAnimatedDrawable for animation control and CircularProgressDrawable for rendering progress visuals via sweep angles.

Tokens
615
Snippets
2
Records
8
Agent score
91%

What's inside circular-progress-button

  1. Integrate Circular Progress Button via JitPack

    master

    To use this library in your Android project, add the JitPack repository to your allprojects block and then add the dependency to your dependencies block in your Gradle files.

    allprojects {
       repositories {
          ...
          maven { url 'https://jitpack.io' }
       }
    }
    
    dependencies {
        implementation 'com.github.dmytrodanylyk:circular-progress-button:$latest'
    }
  2. Configure ProGuard for Circular Progress Button

    master

    If you use ProGuard in your Android project, you must add the following rule to your ProGuard configuration file to prevent the obfuscation of the setStrokeColor method in com.dd.StrokeGradientDrawable.

    -keepclassmembers class com.dd.StrokeGradientDrawable {
        public void setStrokeColor(int);
    }
  3. Get and set CircularAnimatedDrawable properties

    master

    You can manually manipulate the progress state of the drawable using the following methods:

    • setCurrentGlobalAngle(float currentGlobalAngle): Sets the current global angle.
    • getCurrentGlobalAngle(): Retrieves the current global angle.
    • setCurrentSweepAngle(float currentSweepAngle): Sets the current sweep angle (the arc length).
    • getCurrentSweepAngle(): Retrieves the current sweep angle.