MaterialProgressButton

Android library that provides a MaterialButton that allows for a loading state as in the guidelines (https://material.io/components/progress-indicators/) while keeping MaterialButton‘s features.

Add to your project

  1. Add the JitPack repository to your build file

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}
  1. Add the dependency

dependencies {
  implementation 'com.github.ropjov:MaterialProgressButton:0.1.6'
}

How to use it?

  1. Replace your current MaterialButton tags from your .xml with MaterialProgressButton:

<MaterialButton
  ...
/>

for

<com.ropjov.materialprogressbutton.MaterialProgressButton
  ...
/>
  1. Replace your MaterialButton Java/Kotlin objects with MaterialProgressButton objects:
private lateinit var button: MaterialButton
private lateinit var button: MaterialProgressButton
  1. Use progress functions from your Activity or Aragment:

button.showLoading()
button.hideLoading()

For an example check the app module of this project

GitHub

View Github