Skip to content

jongkk7/YLoadingView

Repository files navigation

Loaing View Library

Introduce

This library helps you easily use LoadingView.
I used Lottie library from AirBnB.
It is much less memory than using gif or frame animation.

ScreenShot

simple

DrawingDrawingDrawing

material

DrawingDrawingDrawingDrawing

dynamic

DrawingDrawingDrawingDrawingDrawingDrawingDrawingDrawing

unique

DrawingDrawingDrawingDrawingDrawingDrawingDrawing

Requirements

  • Android 5.0 or greater
  • minSdkVersion 21
  • targetSdkVersion 27

Dependencies

  • implementation 'com.airbnb.android:lottie:2.5.4'

Installation

  • 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}'
  }

Useable

  • 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();

Styles

  • LoadingStyle.SIMPLE_LOADING_01 ~ 03
  • LoadingStyle.MATERIAL_LOADING_01 ~ 04
  • LoadingStyle.DYNAMIC_LOADING_01 ~ 08
  • LoadingStyle.UNIQUE_LOADING_01 ~ 07

Method

  • setScale(float scale)
  • setSpeed(int speed)
  • setCanceledOnTouchOutside(boolean cancel)
  • setCancelable(boolean cancel)
  • show();
  • dismiss();

TODO

Add method & animaton styles

  • setBackgroundColor
  • setColor