Android Loading Fragment
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
androidloadingfragment
app
gradle/wrapper
.gitignore
.travis.yml
LICENSE.md
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
loading.png
loading_fragment.gif
settings.gradle

README.md

Loading Fragment

API Build Status

A Simple LoadingFragment completely compatible with Kotlin and androidX

Releases:

Current release:

Usage:

To show loading

    private fun showLoading() {
        LoadingFragment.getInstance()?.show(supportFragmentManager, "TAG")
    }

To hide loading dialog

    private fun hideLoading() {
      LoadingFragment.getInstance()?.dismissDialog()
    }

To change the animation

LoadingFragment uses lottie to show beatiful animations. to change the default animation:

1- put your json file in assets folder

2- follow this code :

    private fun showLoading() {
        LoadingFragment.getInstance(fileName = "your_file_name.json")?.show(supportFragmentManager, "TAG")
    }

To change cancelable

    private fun showLoading() {
        LoadingFragment.getInstance(isCancelable = true)?.show(supportFragmentManager, "TAG")
    }

Note : to use this library with java

    private void showLoading() {
        LoadingFragment.Companion.getInstance("loading.json",false).show(getSupportFragmentManager(),"TAG");
    }
    private void hideLoading() {
        LoadingFragment.Companion.getInstance("loading.json",false).dismissDialog();
    }

Download

Adding the depencency

Add this to your root build.gradle file:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Now add the dependency to your app build.gradle file:

   implementation 'com.github.SirLordPouya:LoadingFragment:1.0.0'

License

LoadingFragment is released under the Apache License 2.0. See LICENSE for details.

Copyright (c) 2018 Pouya Heydari

Icon is made by bqlqn from www.flaticon.com is licensed by CC 3.0 BY