This library helps you easily use LoadingView.
I used Lottie library from AirBnB.
It is much less memory than using gif or frame animation.
- Android 5.0 or greater
- minSdkVersion 21
- targetSdkVersion 27
- implementation 'com.airbnb.android:lottie:2.5.4'
- Gradle - build.gradle (Module:app)
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
compile 'com.github.jongkk7:YLoadingView:2.0.0'
// compile 'com.github.jongkk7:YLoadingView:{last version}'
}
- Very Simple!
// YLoadingView yLoadingView = new YLoadingView.Builder().load(this, LoadingStyle.SIMPLE_LOADING_01).build();
YLoadingView loadingView = new YLoadingView.Builder()
.load(this, json) // init
.setScale(2.0f) // size * 2.0f
.setSpeed(2) // speed * 2.0f
.build();
yLoadingView.show();
// yLoadingView.dismiss();
tip!
You can download the Lottie animation and customize it.
Click here -> Lottie Animation page new YLoadingView.Builder().builder(this, json).show();
- LoadingStyle.SIMPLE_LOADING_01 ~ 03
- LoadingStyle.MATERIAL_LOADING_01 ~ 04
- LoadingStyle.DYNAMIC_LOADING_01 ~ 08
- LoadingStyle.UNIQUE_LOADING_01 ~ 07
- setScale(float scale)
- setSpeed(int speed)
- setCanceledOnTouchOutside(boolean cancel)
- setCancelable(boolean cancel)
- show();
- dismiss();
Add method & animaton styles
- setBackgroundColor
- setColor