├── .gitignore ├── LICENSE.txt ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── marcok │ │ └── stepprogresssample │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── marcok │ │ └── stepprogresssample │ │ └── MainActivity.java │ └── res │ ├── drawable │ ├── checkmark.png │ └── wrongmark.png │ ├── layout │ └── activity_main.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ └── values │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── stepprogressbar ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src ├── androidTest └── java │ └── com │ └── marcok │ └── stepprogressbar │ └── ApplicationTest.java └── main ├── AndroidManifest.xml ├── java └── com │ └── marcok │ └── stepprogressbar │ └── StepProgressBar.java └── res └── values ├── attrs.xml └── strings.xml /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | 9 | #built application files 10 | *.apk 11 | *.ap_ 12 | 13 | # files for the dex VM 14 | *.dex 15 | 16 | # Java class files 17 | *.class 18 | 19 | # generated files 20 | bin/ 21 | gen/ 22 | 23 | # Local configuration file (sdk path, etc) 24 | local.properties 25 | 26 | # Windows thumbnail db 27 | Thumbs.db 28 | 29 | # OSX files 30 | .DS_Store 31 | 32 | # Eclipse project files 33 | .classpath 34 | .project 35 | 36 | # Android Studio 37 | *.iml 38 | .idea 39 | #.idea/workspace.xml - remove # and delete .idea if it better suit your needs. 40 | .gradle 41 | build/ -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Stephen Marcok 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # StepProgressBar 2 | An Android progress bar that uses coloured circles or drawables, and can be "stepped through" by calling `next()`. 3 | 4 | ![](http://i.imgur.com/kGQZL4H.png) 5 | ![](http://i.imgur.com/K5TVIE5.png) 6 | ![](http://i.imgur.com/UFVWpPN.png) 7 | ## Gradle 8 | ````groovy 9 | dependencies { 10 | .... 11 | compile 'com.marcok.stepprogressbar:stepprogressbar:1.0.1' 12 | } 13 | ```` 14 | ## Usage 15 | ````xml 16 | 30 | ```` 31 | * If dot icons are provided, they override dot colors 32 | * Layout height is irrelevant and determined by the `dotSize` 33 | * To move to the next dot or previous dot: 34 | ````java 35 | StepProgressBar mStepProgressBar = (StepProgressBar)findViewById(R.id.stepProgressBar); 36 | mStepProgressBar.next(); 37 | mStepProgressBar.previous(); 38 | ```` 39 | * To set the dots to be cumulative (all dots <= the specified index will show as active), call `setCumulativeDots(true)` 40 | * Calling `setCurrentProgressDot(-1)` will prevent any dots from showing as active. Any lower values will throw `IndexOutOfBoundsExeption`. 41 | * Other methods: 42 | ```` 43 | setCurrentProgressDot() 44 | setNumDots() 45 | setActiveColor() 46 | setInactiveColor() 47 | setActiveDrawable() 48 | setInactiveDrawable() 49 | ```` 50 | 51 | ## Changelog 52 | * [changelog.txt](changelog.txt) 53 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "22.0.1" 6 | 7 | defaultConfig { 8 | applicationId "com.marcok.stepprogresssample" 9 | minSdkVersion 10 10 | targetSdkVersion 22 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | compile 'com.android.support:appcompat-v7:22.2.0' 25 | compile project(':stepprogressbar') 26 | } 27 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/stephen/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/marcok/stepprogresssample/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.marcok.stepprogresssample; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/marcok/stepprogresssample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.marcok.stepprogresssample; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.Button; 7 | 8 | import com.marcok.stepprogressbar.StepProgressBar; 9 | 10 | public class MainActivity extends AppCompatActivity implements View.OnClickListener { 11 | 12 | private StepProgressBar mStepProgressBar; 13 | private int counter = 0; 14 | 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | setContentView(R.layout.activity_main); 19 | 20 | mStepProgressBar = (StepProgressBar)findViewById(R.id.stepProgressBar); 21 | 22 | Button prev = (Button) findViewById(R.id.button_prev); 23 | Button next = (Button) findViewById(R.id.button_next); 24 | Button remove = (Button) findViewById(R.id.button_remove); 25 | Button add = (Button) findViewById(R.id.button_add); 26 | Button cumulative = (Button) findViewById(R.id.button_cumulative); 27 | prev.setOnClickListener(this); 28 | next.setOnClickListener(this); 29 | remove.setOnClickListener(this); 30 | add.setOnClickListener(this); 31 | cumulative.setOnClickListener(this); 32 | } 33 | 34 | @Override 35 | public void onClick(View view) { 36 | switch(view.getId()){ 37 | case R.id.button_prev: 38 | mStepProgressBar.previous(); 39 | break; 40 | case R.id.button_next: 41 | mStepProgressBar.next(); 42 | break; 43 | case R.id.button_add: 44 | mStepProgressBar.setNumDots(mStepProgressBar.getNumDots()+1); 45 | break; 46 | case R.id.button_remove: 47 | mStepProgressBar.setNumDots(mStepProgressBar.getNumDots()-1); 48 | break; 49 | case R.id.button_cumulative: 50 | mStepProgressBar.setCumulativeDots(counter++%2==0); 51 | break; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/checkmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcokstephen/StepProgressBar/7088c6f2489225c512ec4c5e43c382314e5d974c/app/src/main/res/drawable/checkmark.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/wrongmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcokstephen/StepProgressBar/7088c6f2489225c512ec4c5e43c382314e5d974c/app/src/main/res/drawable/wrongmark.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 22 | 23 |