Skip to content

An android library through which users can add a customized loading dialog box with Lottie Animations.

License

Notifications You must be signed in to change notification settings

SiddyDevelops/CustomLottieDialogBox-Android

Repository files navigation

CustomLottieDialogBox

Coding

About

CustomLottieDialogBox is an android library which facilitate developers to add customized loading Dialog-Boxes to their android apps. Users can add Lottie Animations of thier wish or can choose from the already existing animation. They can change the backgroung color, text color, size of dialog box or can add thier own custom text using this library.

Minimum SDK Version Platform


Installation:

  • Step 1. Add it in your root build.gradle at the end of repositories:
allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
  • Step 2. Add the dependency:
dependencies {
	        implementation 'com.github.SiddyDevelops:CustomLottieDialogBox-Android:0.2.0'
	}

Usage:

In your activity.java follow the steps given below to add the custom Dialog:

  • To add an animation from the library-builtin:

     CustomLottieDialog customLottieDialog;
     customLottieDialog = new CustomLottieDialog(context, "LO01");
     customLottieDialog.show();
    
  • To add your own custom Lottie animation: First download Lottie JSON of your preferred animation and add the downloaded file to raw inside res.

LottiePreview

CustomLottieDialog customLottieDialog;
customLottieDialog = new CustomLottieDialog(context,R.raw.heartbeat_loader);
customLottieDialog.show();
  • To customize the Loading Text:

     customLottieDialog.setLoadingText("Custom Text");
     		OR
     customLottieDialog.setLoadingText("");          //-----> To remove custom text
    
  • To change text-color of custom loading text:

     customLottieDialog.setLoadingTextColor("{HexColorCode}");
    
  • To change Lottie animation background color:

     customLottieDialog.setLottieBackgroundColor("{HexColorCode}");
    
  • To change the dimensions of the dialog box:

     customLottieDialog.setDialogLayoutDimensions({width in dp (int)},{height in dp (int));
    
  • To dismiss the dialog box:

     customLottieDialog.dismiss();
    
  • Example:

     CustomLottieDialog customLottieDialog;
     customLottieDialog = new CustomLottieDialog(MainActivity.this, "LO01");
     customLottieDialog.setLottieBackgroundColor("#7AC89E");
     customLottieDialog.setLoadingText("Custom Text");
     customLottieDialog.setLoadingTextColor("#FFFFFF");
    

Library-Inbuilt Animations:

Animation lottieBatch
PaperPlane "LO01"
Balance "LO03"
Loop "LO05"
Rocket "LO07"
Animation lottieBatch
Bubble "LO02"
Groove "LO04"
Music "LO06"
Spiral "LO08"

From the Developer:

This Android Library is developed by Siddharth Singh. The animation included in this library is taken from https://lottiefiles.com/ .

Follow my Social Handles for more projects.

Enjoy Coding!! 🚀 ✨


About

An android library through which users can add a customized loading dialog box with Lottie Animations.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages