MaDialog Library

General

Category
Free
Tag
Dialogs
License
N/A
Min SDK
16 (Android 4.1 Jelly Bean)
Registered
Jul 2, 2019
Favorites
0
Link
https://github.com/umairayub79/MaDialog
See also
dialogplus
Fusion
Generic Dialog
SearchableSpinner
BottomSheet

Additional

Language
Kotlin
Version
1.4 (Mar 5, 2020)
Created
Jul 2, 2019
Updated
Apr 21, 2020
Owner
Umair Ayub (umairayub79)
Contributor
Umair Ayub (umairayub79)
1
Activity
Badge
Generate
Download
Source code
APK file

Promotion

MaDialog

Material Alert Dialog

  • min SDK 16
  • was written in Java now in Kotlin
  • simple beautiful dialogs with image and GIF support

Screenshots

Installation

Add this into your project's root build.gradle file

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

Add the dependency to your module build.gradle:

dependencies {
 implementation 'com.github.umairayub79:MaDialog:1.3'
}

Example Usage

//build a simple dialog

 new MaDialog.Builder(MainActivity.this)
                        .setTitle("Example Dialog")
                        .setMessage("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis scelerisquevel. ")
                        .setPositiveButtonText("ok")
                        .setNegativeButtonText("cancel")
   setButtonOrientation(LinearLayout.HORIZONTAL)
                        .AddNewButton(R.style.AppTheme, "Yes", new MaDialogListener() {
                            @Override
                            public void onClick() {

                            }
                        })
                        .setPositiveButtonListener(new MaDialogListener() {
                            @Override
                            public void onClick() {
                              //todo
                            }
                        })
                        .setNegativeButtonListener(new MaDialogListener() {
                            @Override
                            public void onClick() {
                              //todo
                            }
                        })
                        .build();


//Available Methods

.setTitle(String);
.setMessage(String);
.setImage(int);
.setGif(int);
.setMessageTextColor(int);
.setTitleTextColor(int);
.setButtonTextColor(int);
.AddNewButton(int,String,MaDialogListener);
.setButtonOrientation(int);
.setBackgroundColor(int);
.setNegativeButtonText(String);
.setPositiveButtonText(String);
.setCancelableOnOutsideTouch(boolean);
.setPositiveButtonListener(MaDialogListener);
.setNegativeButtonListener(MaDialogListener);
.build();