Android Library to create Lottie animation view dialog easily with a lot of customization

Overview

LottieDialog

Build Codacy Badge CodeFactor Min API Level Maven Central Jitpack Version

Android Library to create Lottie animation view dialog easily with a lot of customization

animated animated animated animated

Why you should use Lottie Dialog

  • You have no limited type of dialog, you create your own types and using them.
  • You don't need to add unused file in your project, just add what you will use.
  • You can add any number of buttons and customize them as you want.
  • Customize dialog title as you want, change color, size and visibility.
  • Customize dialog message as you want, change color, size and visibility.
  • You can change your dialog width and height by number of by percentage.
  • You can change the animation view width and height.
  • Set your animation easily from assets, raw resources or URLs.
  • And more...

Download or create Lottie animation file

Add Lottie Dialog to your project

From Maven Central

implementation 'io.github.amrdeveloper:lottiedialog:1.0.0'
Or Add LottieDialog from Jitpack.io

Add it in your root build.gradle at the end of repositories

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

Add the dependency

implementation 'com.github.amrdeveloper:lottiedialog:1.0.0'

And sync the Gradle.

Code Example

Button okButton = new Button(this);
okButton.setText("Ok");
okButton.setOnClickListener(view -> {});

Button cancelButton = new Button(this);
cancelButton.setText("Cancel");
cancelButton.setOnClickListener(view -> {});

LottieDialog dialog = new LottieDialog(this)
    .setAnimation(R.raw.animation)
    .setAnimationRepeatCount(LottieDrawable.INFINITE)
    .setAutoPlayAnimation(true)
    .setTitle("Title")
    .setTitleColor(Color.WHITE)
    .setMessage("Message...")
    .setMessageColor(Color.WHITE)
    .setDialogBackground(Color.BLACK)
    .setCancelable(false)
    .addActionButton(okButton)
    .addActionButton(cancelButton)
    .setOnShowListener(dialogInterface -> {})
    .setOnDismissListener(dialogInterface -> {})
    .setOnCancelListener(dialogInterface -> {});
dialog.show();

Documentation

Lottie Dialog was designed with a fluent interface concept and with the goal to make it customizable as much as we can

Set dialog title.

setTitle(String title);

Set dialog title color.

setTitleColor(int color)

Set dialog title text size.

setTitleTextSize(float size)

Set dialog title visibility, the default value is View.VISIBLE.

setTitleVisibility(int visibility)

Set dialog message.

setMessage(String message)

Set dialog message text size.

setMessageTextSize(float size)

Set message visibility, the default value is View.VISIBLE.

setMessageVisibility(int visibility)

Set dialog background color.

setDialogBackground(int color)

Set dialog background drawable.

setDialogBackgroundDrawable(Drawable drawable)

Set dialog dim amount.

setDialogDimAmount(float amount)

Set dialog cancelable.

setCancelable(boolean cancelable)

Set dialog canceled on touch outside.

setCanceledOnTouchOutside(boolean cancel)

Set dialog height.

setDialogHeight(int height)

Set dialog width.

setDialogWidth(int width)

Set dialog height by percentage, for example 0.50f for 50%.

setDialogHeightPercentage(float percentage)

Set dialog width by percentage, for example 0.50f for 50%.

setDialogWidthPercentage(float percentage)

Set Lottie animation view height.

setAnimationViewHeight(int height)

Set Lottie animation view width.

setAnimationViewWidth(int width)

Set animation from raw resources.

setAnimation(@RawRes int rawRes)

Set animation from Animation object.

setAnimation(Animation animation)

Set animation from assets folder

setAnimation(String assetName)

Set animation from URL, need INTERNET permission

setAnimationFromUrl(String url)

Set repeat count for the animation, for indefinitely use LottieDialog.INFINITE

setAnimationRepeatCount(int count)

Set animation speed

setAnimationSpeed(float speed)

Add action button, you should set listeners and customize it then add it to Lottie dialog

addActionButton(Button button)

Add action button with the index

addActionButton(Button button, int index)

Control auto play animation when the dialog is showing

setAutoPlayAnimation(boolean autoplay)

Check animation auto playing value

isAutoPlayedAnimation()

Play the animation.

playAnimation()

Pause the animation.

pauseAnimation()

cancel the animation.

cancelAnimation()

clear the animation.

clearAnimation()

reverse the animation speed.

reverseAnimationSpeed()

Check if is animating or not.

isAnimating()

Show Lottie dialog.

show()

Check if Lottie dialog is showing.

isShowinng()

Dismiss Lottie dialog.

dismiss()

Cancel Lottie dialog`.

cancel()

Listen when Lottie dialog is showing.

setOnShowListener(DialogInterface.OnShowListener listener)

Listen when Lottie dialog is canceled.

setOnCancelListener(DialogInterface.OnCancelListener listener)

Listen when Lottie dialog is dismissed.

setOnDismissListener(DialogInterface.OnDismissListener listener)

How to contribute

  • You are most welcome to request features, report bugs by creating a new issues.
  • Before starting implementing the feature please make sure the issue is approved and assigned to you.
You might also like...

Bring back Youtube Dislike for Android (View Only)

Show Youtube Dislikes Bring back Youtube Dislikes for Android This is a simple application, that parses the data from the "returnyoutubedislike.com" A

Nov 17, 2022

RTL marquee text view android right to left moving text - persian - farsi - arabic - urdo

RTL marquee text view android right to left moving text - persian - farsi - arabic - urdo

RtlMarqueeView RTL marquee text view can hande the speed of moving text can jump to the specefic position of the text at start can loop the marquee te

Feb 14, 2022

There are two challenges one is to create a backend api the other is to create a frontend application to consume the public data api devall.

There are two challenges one is to create a backend api the other is to create a frontend application to consume the public data api devall.

Sobre | Desafio | Resolução | Tecnologias | Execução | Itexto desafio tecnico Sobre os Desafios existem dois desafios um é criar uma api backend o out

Oct 18, 2021

React native wrapper for Jitsi Meet SDK Library that rely on the native view (Activity / ViewController)

react-native-jitsi-meet-sdk React native wrapper for Jitsi Meet SDK Library. This Library implements the Jitsi SDK with a native activity on the Andro

May 2, 2022

A minimalistic Face Recognition module which can be easily incorporated in any Android project.

A minimalistic Face Recognition module which can be easily incorporated in any Android project.

Real Time Face Recognition with TfLite A minimalistic Face Recognition module which can be easily incorporated in any Android project. Key Features Fa

Jun 21, 2022

With react-native-update-in-app library you can easily implement in-app updates in your React Native app using CDN or any other file server

React Native In-App update With react-native-update-in-app library you can easily implement in-app updates in your React Native app using CDN or any o

Dec 21, 2022

Small app to create icon sets for Linux, Windows, OSX, Android and IOS from a single PNG image

FXIconcreator Small app to create icon sets (multi resolution) for Linux, Windows, OSX from a single PNG image Reason for creating such an app was tha

Aug 4, 2022

A visual implementation of OSHI, to view information about the system and hardware.

A visual implementation of OSHI, to view information about the system and hardware.

MooInfo A visual implementation of OSHI, to view information about the system and hardware. Such as OS, processes, memory, CPU, disks, devices, sensor

Jan 6, 2023

Tracks information (skills, inventory, bank, etc.) about a group ironman player and sends it to a website for other group members to view

Tracks information (skills, inventory, bank, etc.) about a group ironman player and sends it to a website for other group members to view

Group Ironmen Tracker Plugin Website: groupiron.men Source for frontend and server: https://github.com/christoabrown/group-ironmen This plugin tracks

Nov 11, 2022
Releases(1.0.0)
Owner
Amr Hesham
Software Engineer interested in Android Development and PL Design
Amr Hesham
Cute view animation collection.

Android View Animations One day, I saw an iOS library, which is a view shaker, it's very beautiful. I think Android also need one, and should be bette

代码家 12.2k Dec 28, 2022
Lottie wrapper for React Native.

Lottie for React Native, iOS, and Android Lottie component for React Native (iOS and Android) Lottie is a mobile library for Android and iOS that pars

Lottie - React Native 15.6k Jan 7, 2023
Better performance with lottie animations using RLottie in react-native

?? react-native-rlottie Features ▶️ Uses rlottie to run lottie animations ?? rlottie creates rasterized bitmaps for each frame of the animation (inste

Skill Nation 23 Dec 7, 2022
About I build a custom animated alert dialog with rounded corners - Java🚀🔥

Custom Animated AlertDialog Animated AlertDialog With Rounded Corners Alert Dialog Style First you need add this code to your project themes.xml file

Kaveesha Anuhas 2 Jul 15, 2022
Lattice is a powerful, lightweight business extension invoke framework. By using the Lattice framework, complex business customization can be efficiently organized and managed.

Lattice Framework Introduction Lattice is a powerful, lightweight business extension invoke framework. By using the Lattice framework, complex busines

null 41 Dec 30, 2022
A beautiful material calendar with endless scroll, range selection and a lot more!

CrunchyCalendar A light, powerful and easy to use Calendar Widget with a number out of the box features: Infinite vertical scrolling in both direction

CleverPumpkin 484 Jan 7, 2023
Rivr is a lightweight open-source dialogue engine enabling Java developers to easily create enterprise-grade VoiceXML applications.

Overview Rivr is a lightweight open-source dialogue engine enabling Java developers to easily create enterprise-grade VoiceXML applications. Read our

Nu Echo Inc. 57 Jun 27, 2022
JSON Web Token implementation for Java according to RFC 7519. Easily create, parse and validate JSON Web Tokens using a fluent API.

JWT-Java JSON Web Token library for Java according to RFC 7519. Table of Contents What are JSON Web Tokens? Header Payload Signature Features Supporte

Bastiaan Jansen 6 Jul 10, 2022
Android Auto Apps Downloader (AAAD) is an app for Android Phones that downloads popular Android Auto 3rd party apps and installs them in the correct way to have them in Android Auto.

Android Auto Apps Downloader (AAAD) is an app for Android Phones that downloads popular Android Auto 3rd party apps and installs them in the correct way to have them in Android Auto.

Gabriele Rizzo 865 Jan 2, 2023
Allows changing of hurt animation modifier, changing how much the user's camera moves after the player being hurt.

Hurt Animation Modifier Allows changing of hurt animation modifier, changing how much the user's camera moves after the player being hurt. Credit to W

null 5 May 17, 2022