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 the JitPack repository to your build file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Add the dependency
dependencies {
implementation 'com.github.ropjov:MaterialProgressButton:0.1.6'
}
- Replace your current
MaterialButton
tags from your .xml withMaterialProgressButton
:
<MaterialButton
...
/>
for
<com.ropjov.materialprogressbutton.MaterialProgressButton
...
/>
- Replace your
MaterialButton
Java/Kotlin objects withMaterialProgressButton
objects:
private lateinit var button: MaterialButton
private lateinit var button: MaterialProgressButton
- Use progress functions from your Activity or Aragment:
button.showLoading()
button.hideLoading()
For an example check the app module of this project