FranAguilera/franjam-custom-progress-bar


Basic Android custom progress bar which allows to change progress images via XML for an easier configuration( API 15 and up)

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.FranAguilera:franjam-custom-progress-bar:'
	}
	dependencies {
		implementation("com.github.FranAguilera:franjam-custom-progress-bar:")
	}
	<dependency>
	    <groupId>com.github.FranAguilera</groupId>
	    <artifactId>franjam-custom-progress-bar</artifactId>
	    <version></version>
	</dependency>

                            
    libraryDependencies += "com.github.FranAguilera" % "franjam-custom-progress-bar" % ""
        
        

                            
    :dependencies [[com.github.FranAguilera/franjam-custom-progress-bar ""]]
        
        

Readme


franjam-custom-progress-bar

The purpose of this library is to have an easily configurable ProgressBar via xml which allows to change top progress drawable and background drawable.

For ussage, after import:

1) Add to the root of your main xml layout

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

2) Declare your custom-progress-bar on your xml like this:


  <franjam.ui.FranJamProgressBar
        android:id="@+id/custom_progress_bar"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:visibility="visible"
        app:maxLevel="200"
        app:backgroundDrawable="@drawable/custom_background_drawable"
        app:progressDrawable="@drawable/custom_progress_vector_drawable" />

2) XML attributes:

  • maxLevel: Define the max progress possible value. If not specified max will be 100 (Only positive values)
  • backgroundDrawable: Specify drawable (or svg) for a background image progress
  • progressDrawable: Specify drawable (or svg) for a main progress (ClipDrawable)

NOTE: If drawables are not specified in xml it will use default_progress.png and default_background.png

3) Default images demo:

Default sample 1

Default sample 2

Default sample 3

Default sample 4