MCPcopy Index your code
hub / github.com/Todd-Davies/ProgressWheel

github.com/Todd-Davies/ProgressWheel @1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.2 ↗ · + Follow
69 symbols 119 edges 2 files 14 documented · 20%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Progress Wheel

This is a custom component for Android intended for use instead of a progress bar.

Sample Image Sample Image 3 Sample Image 4

Compare it side by side with the Android 2x progress wheel:

Sample Image 5

A complete walkthrough of how to use this component in your app

XML:
To implement the view in your xml layout do the following:

  1. Add the following to your attrs.xml file (in res/values):
<declare-styleable name="ProgressWheel">   
    <attr name="text" format="string" />   
    <attr name="textColor" format="color" />   
    <attr name="textSize" format="dimension" />   
    <attr name="barColor" format="color" />   
    <attr name="rimColor" format="color" />   
    <attr name="rimWidth" format="dimension" />   
    <attr name="spinSpeed" format="integer" />     
    <attr name="circleColor" format="color" />     
    <attr name="radius" format="dimension" />   
    <attr name="barWidth" format="dimension" />   
    <attr name="barLength" format="dimension" />
    <attr name="delayMillis" format="dimension"/>
    <attr name="contourColor" format="color"/>
    <attr name="contourSize" format="float"/>
</declare-styleable> 
  1. Add the following code to the root view of your layout: xmlns:ProgressWheel="http://schemas.android.com/apk/res/com.visualdenim.schooltraq"

  2. Add the widget code in the appropriate place in your xml file. Here's a sample implementation:

<com.todddavies.components.progressbar.ProgressWheel   
    android:id="@+id/pw_spinner"     
    android:layout_width="200dp"    
    android:layout_height="200dp"   
    android:layout_centerInParent="true"   
    ProgressWheel:text="Authenticating..."    
    ProgressWheel:textColor="#222"   
    ProgressWheel:textSize="14sp"   
    ProgressWheel:rimColor="#330097D6"   
    ProgressWheel:barLength="60dp"    
    ProgressWheel:barColor="#0097D6"   
    ProgressWheel:barWidth="5dp"   
    ProgressWheel:rimWidth="2dp" /> 

Java:
First you need to either get a ProgressWheel from a layout file, or initalise one. Do this by:

  • ProgressWheel pw = new ProgressWheel(myContext, myAttributes);
  • ProgressWheel pw = (ProgressWheel) findViewById(R.id.pw_spinner);

To spin the progress wheel, you just call .spin() and to stop it spinning, you call .stopSpinning()

Incrementing the progress wheel is slightly more tricky, you call .incrementProgress(). However, this is out of 360,
(because a circle has 360 degrees), and will automatically reset once you get past 360. A percentage display is
automatically displayed.

Using as a dependency

Add this to your build.gradle:

    repositories {
        maven { url "https://jitpack.io" }
    }

    dependencies {
        compile 'com.github.Todd-Davies:ProgressWheel:1.0'
    }

Using as a library project

To use it as a library in Android Studio, please edit build.gradle.

Modify:

apply plugin: 'android'

Into:

apply plugin: 'android-library'

Since Android SDK Tools revision 17 (released March 2012), this component can be used as a library project. In this case, you do not need to copy anything into your project's attrs.xml, and you must use the following namespace URI, instead of the above:

xmlns:ProgressWheel="http://schemas.android.com/apk/res-auto"

Otherwise, usage should be the same.

Todd Davies - @Todd__Davies - 2012

Core symbols most depended-on inside this repo

setText
called by 6
src/com/todddavies/components/progressbar/ProgressWheel.java
getPaddingTop
called by 3
src/com/todddavies/components/progressbar/ProgressWheel.java
getPaddingBottom
called by 3
src/com/todddavies/components/progressbar/ProgressWheel.java
getPaddingLeft
called by 3
src/com/todddavies/components/progressbar/ProgressWheel.java
getPaddingRight
called by 3
src/com/todddavies/components/progressbar/ProgressWheel.java
stopSpinning
called by 2
src/com/todddavies/components/progressbar/ProgressWheel.java
startSpinning
called by 2
src/com/todddavies/components/progressbar/ProgressWheel.java
setProgress
called by 2
src/com/todddavies/components/progressbar/ProgressWheel.java

Shape

Method 65
Class 4

Languages

Java100%

Modules by API surface

src/com/todddavies/components/progressbar/ProgressWheel.java53 symbols
src/com/todddavies/components/progressbar/Main.java16 symbols

For agents

$ claude mcp add ProgressWheel \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact