/ Dialogs

A Beautiful Dialog Library for Kotlin Android

A Beautiful Dialog Library for Kotlin Android

Awesome Dialog

A Beautiful Multipurpose Awesome Dialogs Library in Android using Kotlin.

Showcase

Showcase

About

A Beautiful Multipurpose Awesome Dialogs Library in Android using Kotlin.

Dependency Project Level

Step 1. Add the JitPack repository to your build file

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

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

Dependency App Level

Add dependency in your app module

	dependencies {
	        implementation 'com.github.chnouman:AwesomeDialog:1.0.4'
	}

Simple Dialog 🖐🏼

AwesomeDialog.build(this)
                .title("Congratulations")
                .body("Your New Account has been created")
                .onPositive("Go To My Account") {
                    Log.d("TAG", "positive ")
                } 

Dialog With Icon ⌛️

AwesomeDialog.build(this)
		.title("Congratulations")
                .body("Your New Account has been created")
		.icon(R.drawable.ic_congrts)
                .onPositive("Go To My Account") {
                    Log.d("TAG", "positive ")
                }       

Usage

Sample Code for 🌟

Icon+Title+Body

AwesomeDialog.build(this)
                .title(title)
                .body(body)
                .icon(R.drawable.ic_congrts)                

Output

Icon+Title+Body+ (+ Button)

   AwesomeDialog.build(this)
                .title(title)
                .body(body)
                .icon(R.drawable.ic_congrts)
                .onPositive(goToMyAccount) {
                    Log.d("TAG", "positive ")
                }

Output

Icon+Title+Body+ (+/- Button)

AwesomeDialog.build(this)
                .title(title)
                .body(body)
                .icon(R.drawable.ic_congrts)
                .onPositive(goToMyAccount) {
                    Log.d("TAG", "positive ")
                }
                .onNegative(cancel) {
                    Log.d("TAG", "negative ")
                }
        

Output

Title+Body+ (- Button)

AwesomeDialog.build(this)
                .title(title)
                .body(body)
                .onPositive(goToMyAccount) {
                    Log.d("TAG", "positive ")
                }

Output

Title+Body+ (+/- Button)

       AwesomeDialog.build(this)
                .title(title)
                .body(body)
                .onPositive(goToMyAccount) {
                    Log.d("TAG", "positive ")
                }
                .onNegative(cancel) {
                    Log.d("TAG", "negative ")
                }  

Output

Title+Body+ (+/- Button) With Backgroud 🌈

  AwesomeDialog.build(this)
                .title(
                    title,
                    titleColor = ContextCompat.getColor(this, android.R.color.white)
                )
                .body(
                    body,
                    color = ContextCompat.getColor(this, android.R.color.white)
                )
                .background(R.drawable.layout_rounded_dark_black)
                .onPositive(goToMyAccount) {
                    Log.d("TAG", "positive ")
                }
                .onNegative(cancel) {
                    Log.d("TAG", "negative ")
                }
                

Output

Custom Coloring 🌈

  AwesomeDialog.build(this)
                .title(
                    title,
                    titleColor = ContextCompat.getColor(this, android.R.color.white)
                )
                .body(
                    body,
                    color = ContextCompat.getColor(this, android.R.color.white)
                )
                .icon(R.drawable.ic_congrts)
                .background(R.drawable.layout_rounded_green)
                .onPositive(
                    goToMyAccount,
                    buttonBackgroundColor = R.drawable.layout_rounded_dark_white,
                    textColor = ContextCompat.getColor(this, android.R.color.black)
                ) {
                    Log.d("TAG", "positive ")
                }                

Output

Positioning

We can customize the Position of Dialog.

POSITIONS.CENTER
POSITIONS.BOTTOM

By Default Position is Bottom.

CENTER BOTTOM

Awesome Attributes Properties

title()

Parameter Type Default Value
title String Empty String
fontStyle TypeFace Android Default
titleColor Int Android Default Color

body()

Parameter Type Default Value.
body String Empty String.
fontStyle Typeface Android Default.
color Int Android Default Text Color.

icon()

Parameter Type Default Value
icon Int Not Null
animateIcon Boolean false

position()

Parameter Type Default Value
position POSITIONS POSITIONS.BOTTOM

background()

Parameter Type Default Value
dialogBackgroundColor INT DEFAULT

onPositive()

Parameter Type Default Value
text String Empty String
buttonBackgroundColor Int Default Color
action () -> Unit Empty

onNegative()

Parameter Type Default Value
text String Empty String
buttonBackgroundColor Int Default Color
action () -> Unit Empty

GitHub

Comments