Jithin-Jude / lib_simpleloader

Codebase for testing custom personal libraries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple Fullscreen loader

HitCount

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.

Buy Me a Coffee

Usage

Sample project

See sample directory. Sample project is under construction.

Dependencies

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

Loader initialization

var fullScreenLoader: FullScreenLoader? = null
fullScreenLoader = FullScreenLoader(context)
fullScreenLoader?.show()

Loader listener

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)

Making loader dismissible

fullScreenLoader?.setLoaderCancelable(true)

Set Loader Color

fullScreenLoader?.setLoaderColor(getColor(R.color.yellow))

Set Loading message

fullScreenLoader?.setLoadingMessage("Your loading message...")

Suggestions for improvements are welcome

About

Codebase for testing custom personal libraries.

License:MIT License


Languages

Language:Kotlin 100.0%