For the past few years, I was using Lottie for showing both loading & other custom animations. Even tho Lottie is providing cooler animations, one major issue I was facing was that the Lottie files are not doing well in terms of performance.
So here is a simple, performance-oriented, lightweight, easy-to-use library for showing loading screen while app is doing heavy background tasks & network calls.
See sample
directory. Sample project is under construction.
add inside settings.gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
add inside build.gradle
[app level]
dependencies {
implementation 'com.github.Jithin-Jude:lib_simpleloader:1.0.2'
}
import dev.jithinjude.simpleloader.FullScreenLoader
var fullScreenLoader: FullScreenLoader? = null
fullScreenLoader = FullScreenLoader(context)
fullScreenLoader?.show()
val callback = object : FullScreenLoader.FullScreenLoaderListener {
override fun onFullScreenLoaderInitialized() {
fullScreenLoader?.setLoaderColor(getColor(R.color.happy_yellow))
fullScreenLoader?.setLoadingMessage("Loading message...")
}
override fun onFullScreenLoaderDismissed() {
Timber.e("onFulScreenLoaderDismissed :=> callback worked")
}
}
fullScreenLoader?.setFullScreenLoadingDismissListener(callback)
fullScreenLoader?.setLoaderCancelable(true)
fullScreenLoader?.setLoaderColor(getColor(R.color.yellow))
fullScreenLoader?.setLoadingMessage("Your loading message...")