MaterialLoadingButton
A configurable and animated material loading button. If you're an RxJava fan as I am this button will come you really handy.
Usage
Minimum SDK: 21
Currently this widget is running with androidX and also allows the usage of databinding to set the elements comfortably.
Gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.Muki1992:MaterialLoadingButton:1.0'
}
Indicating the loading progress
fun doStuff(view: View) {
loadingButton.onStartLoading()
Handler().postDelayed({
loadingButton.onStopLoading()
}, 500)
}
XML
Accessing attributes programatically
All custom attributes can be set like below:
loadingButton.setButtonOnClickListener(View.OnClickListener)
loadingButton.setButtonColor(Int)
loadingButton.setTextColor(Int)
loadingButton.setButtonText(String)