A Easy And Powerfull Library For Android Dialog
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.amirkateb:AnimationDialogAndroid:1.1.1'
}
This Library Use Lottie For Show Animation (You Can Download Many Free Animation in Json Format in LottieFiles
dependencies {
implementation 'com.airbnb.android:lottie:3.0.7'
}
//Activity is your Activity Or Context like MainActivity.this
AnimationDialog.init(Activity,boolean your choice); //boolean your choice:you can use gride button(true) or linear buton(false)
This Method Return Buttons Array For Buttons Method So:
Button[] buttons;
buttons=AnimationDialog.init(Activity,boolean your choice); //Activity is your Activity Or Context like MainActivity.this
AnimationDialog.create("Title","Sub Text","Button Text!");
buttons[0].setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AnimationDialog.close();
}
});
If Add Secend Button...
buttons[0].setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AnimationDialog.close();
}
});
buttons[1].setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AnimationDialog.close();
}
});
//hex color like #000000
AnimationDialog.add_secend_button("Button Text","colorHex for background buttons color");
AnimationDialog.set_animation("name of your json file name in assets folder","colorHex for background color");
AnimationDialog.set_Sound(your file adress in raw folder); //like R.raw.error
AnimationDialog.set_parent_background("colorHex for background color");
AnimationDialog.change_text_color("colorHex for text color");
AnimationDialog.setCanceledOnTouchOutside(boolean true or false);
AnimationDialog.custom_button_background("#FF1744"); //for your first Button (default its red with curner radius)
AnimationDialog.set_image(your drawable); //you can use on of the animationview or imageview
Some Methods Return Usefull Value...So You Can:
Dialog dialog;
MediaPlayer mediaPlayer;
LottieAnimationView lottieAnimationView;
dialog=AnimationDialog.create("Title","Sub Text","Button Text!");
mediaPlayer=AnimationDialog.set_Sound(your file adress in raw folder);
lottieAnimationView=AnimationDialog.set_animation("name of your json file name in assets folder","colorHex for background color");