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

Overview

LottieDialog

Build Codacy Badge CodeFactor Min API Level 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

Add line below to your top level build.gradle

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

Add lines below to your app level build.gradle

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...
BaseAnimation network Android animation set, custom controls, nearly 200 kinds of source code! BaseAnimation, if a new version is updated automatically to remind everyone, I hope everyone will contribute their animated XML files or other source, together to create this open source app! Android ripple animation helper, easy to create Circular Reveal. | Android水波动画帮助类,轻松实现View show/hide/startActivity()特效。(0.4.6)
Android ripple animation helper, easy to create Circular Reveal. | Android水波动画帮助类,轻松实现View show/hide/startActivity()特效。(0.4.6)

CircularAnim English | 中文 首先来看一个UI动效图。 效果图是是Dribbble上看到的,原作品在此。 我所实现的效果如下: Watch on YouTube Compile 最新可用版本 So,你可以如下compile该项目,也可以直接把这个类 CircularAnim 拷

ArcAnimator helps to create arc transition animation: 2.3.+
ArcAnimator helps to create arc transition animation: 2.3.+

ArcAnimator ArcAnimator helps to create arc transition animation: 14+ | ArcAnimator Demo | TransitionLoop Demo* *TransitionLoop Prototype by Min-Sang

This is a simple util to create Activity transition animation
This is a simple util to create Activity transition animation

TransitionHelper This is a simple util to create Activity transition animation API compatible with Android 2.2+ 中文说明 Screenshots How to use 1.startAct

create your custom themes and change them dynamically with ripple animation
create your custom themes and change them dynamically with ripple animation

Android Animated Theme Manager create your custom themes and change them dynamically with ripple animation Features support java and kotlin projects.

FadingToolbar is an animation library which fades out your footer view in a ScrollView/RecyclerView and fades in a toolbar title
FadingToolbar is an animation library which fades out your footer view in a ScrollView/RecyclerView and fades in a toolbar title

FadingToolbar is an animation library which fades out your footer view in a ScrollView/RecyclerView and fades in a toolbar title (analogue of the LargeTitle animation in iOS)

Android library to animate Floating Action Button to Bottom Sheet Dialog and vice-versa
Android library to animate Floating Action Button to Bottom Sheet Dialog and vice-versa

FabulousFilter Show some ❤️ and star the repo to support the project This library is the implementation of filter-concept posted on MaterialUp.com. It

Continuous speech recognition library for Android with options to use GoogleVoiceIme dialog and offline mode.

Android Speech Recognition This library lets you perform continuous voice recognition in your android app with options to either use Google Voice Ime

Deprecated in favour of https://developer.android.com/reference/android/support/v4/view/animation/PathInterpolatorCompat.html

Deprecated: use https://developer.android.com/reference/android/support/v4/view/animation/PathInterpolatorCompat.html instead. android-cubic-bezier-in

Releases(1.0.0)
Owner
Amr Hesham
Software Engineer interested in Android Development and PL Design
Amr Hesham
Android Annotation Processor library to generate adapter class easily from your model with a lot of customization

Android Annotation Processing Library to generate your adapters only with Annotations on your model, support working with Kapt and KSP Processors

Amr Hesham 63 Nov 24, 2022
A Lottie animations marketplace powered by LottieFiles

Lottie World A Lottie animations playground app to mess around with animations and clean architecture with MVVM. Built with ❤︎ by Wajahat Karim Video

Wajahat Karim 15 Dec 22, 2022
Animated-splash-screen - Animate your Splash Screen using Lottie files.

Animated Splash Screen This small project shows how you can add animation into your android projects or create beautiful looking Splash Screen or Laun

Aashish Ace 0 Jan 2, 2022
RX-based async paradigm, Room, DI (Hilt), Retrofit, MVVM, Jetpack, Lottie, Transitions

CatBreedsApp RxJava, Room, DI (Hilt), Jetpack, Shared element transition. clean MVVM architecture, Retrofit Cats need your help, we want to build an a

Cristian Dumitrache 3 Oct 14, 2022
FilePicker is a small and fast file selector library that is constantly evolving with the goal of rapid integration, high customization, and configurability~

Android File Picker ??️ 中文简体 Well, it doesn't have a name like Rocky, Cosmos or Fish. Android File Picker, like its name, is a local file selector fra

null 786 Jan 6, 2023
💳 Bank Card View is a simple and elegant card view with Flip animation.

Visualização de cartão bancário ?? Bank Card View é uma visualização de cartão simples e elegante com animação Flip. Versões Selecione a língua : Engl

Geovani Amaral 10 Dec 12, 2022
💳 Bank Card View is a simple and elegant card view with Flip animation.

Visualização de cartão bancário ?? Bank Card View é uma visualização de cartão simples e elegante com animação Flip. Versões Selecione a língua : Engl

Geovani Amaral 9 Aug 26, 2022
Android library to control Transition animates. A simple way to create a interactive animation.

TransitionPlayer Android library to control Transition animates. A simple way to create a interactive animation. Demo1 SimpleTransition Code: ....

林法鑫 1.2k Dec 17, 2022
Android library to control Transition animates. A simple way to create a interactive animation.

TransitionPlayer Android library to control Transition animates. A simple way to create a interactive animation. Demo1 SimpleTransition Code: ....

林法鑫 1.2k Dec 17, 2022
Android Animation Easing Functions. Let's make animation more real!

Android Easing Functions This project is originally from my another project, AndroidViewAnimation, which is an animation collection, to help you make

代码家 2.5k Jan 4, 2023