This library aims to help in creating beautiful loading dialogs with animated gifs. Thanks a lot to Fresco, without which it would not be possible for me to create this. :)
val dialog = GifDialog.with(this)
dialog!!
.isCancelable(false)
.setText("Loading...")
.setTextSize(18)
.setTextBackgroundColor(ContextCompat.getColor(this, android.R.color.white))
.setTextColor(ContextCompat.getColor(this, android.R.color.holo_red_dark))
.setResourceId(R.drawable.giphy5)
dialog?.showDialog("TAG_NAME")
dialog?.dismissDialog("TAG_NAME")
Easy enough!!! :) For more customization, refer sample application code.
Add it in your root build.gradle at the end of repositories
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Then, add this in you app level build.gradle
dependencies {
implementation 'com.github.rakezbohara:GifDialog:v0.0.6'
}