DEV Community

Cover image for CuteDialog - A Custom Material Design Dialog Library for Android
K M Rejowan Ahmmed
K M Rejowan Ahmmed

Posted on

1

CuteDialog - A Custom Material Design Dialog Library for Android

Hi,
Today I'm sharing a Custom Material Design Dialog Library named CuteDialog created by CuteLibs Project . I'm a co-author of this repo and tried my best to make a good and reliable library for the community.

CuteDialog

feature

As mentioned on the repo page-

CuteDialog is a Highly Customizable Material Design Android Library. CuteDialog allows developer to create beautiful dialogs with material design. It is highly customizable and can be used for lots of different purposes.

Screenshot

Icon Image Animation
icon image animation

Prerequisites

Add this to your root build.gradle

allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
view raw build.gradle hosted with ❤ by GitHub

Theme

You must use any MaterialComponents Theme. Example-

<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
view raw theme.xml hosted with ❤ by GitHub

Basic Usage

new CuteDialog.withIcon(this)
.setIcon(R.mipmap.ic_launcher)
.setTitle("Simple Dialog")
.setDescription("This is a simple Dialog")
.setPositiveButtonText("Okay", v2 -> {
})
.setNegativeButtonText("Cancel", v2 -> {
})
.show();
view raw Basic.Java hosted with ❤ by GitHub

Advanced

new CuteDialog.withIcon(this)
.setIcon(R.mipmap.ic_launcher)
.setTitle("Simple Dialog")
.setTitleTextSize(20)
.setTitleTextColor(Color.parseColor("#FF4081"))
.setTitleTextStyle(CuteDialog.STYLE_BOLD)
.setDescription("This is a simple Dialog")
.setDescriptionTextColor(Color.parseColor("#FF4081"))
.setDescriptionTextSize(16)
.setDescriptionTextStyle(CuteDialog.STYLE_NORMAL)
.setPositiveButtonText("Okay", v2 -> {
})
.setNegativeButtonText("Cancel", v2 -> {
})
.setCloseIconListener(v2 -> {
})
.setCloseIcon(R.drawable.icon_1)
.setCloseIconColor(Color.parseColor("#FF4081"))
.setCloseIconSize(20)
.setPositiveButtonColor(Color.parseColor("#FF4081"))
.setPositiveButtonRadius(10)
.setPositiveButtonBorderColor(Color.parseColor("#FF4081"))
.setPositiveButtonBorderWidth(2)
.setPositiveButtonTextColor(Color.parseColor("#FFFFFF"))
.setPositiveButtonTextSize(16)
.setPositiveButtonTextStyle(CuteDialog.STYLE_NORMAL)
.setNegativeButtonColor(Color.parseColor("#FFFFFF"))
.setNegativeButtonRadius(10)
.setNegativeButtonBorderColor(Color.parseColor("#FF4081"))
.setNegativeButtonBorderWidth(2)
.setNegativeButtonTextColor(Color.parseColor("#FF4081"))
.setNegativeButtonTextSize(16)
.setNegativeButtonTextStyle(CuteDialog.STYLE_NORMAL)
.setDialogBackgroundColor(Color.parseColor("#FFFFFF"))
.setDialogRadius(10)
.setDialogPosition(CuteDialog.POSITION_CENTER)
.setPadding(20)
.setPrimaryColor(Color.parseColor("#FF4081"))
.isCancelable(true)
.hideNegativeButton(false)
.hidePositiveButton(false)
.hideDescription(false)
.hideTitle(false)
.hideCloseIcon(false)
.show();
view raw Advanced.java hosted with ❤ by GitHub

Customizations

new CuteDialog.withImage(this)
.setImage(R.drawable.image_1)
.setTitle("Take a break")
.setDescription("Isn't it a great time to go for a walk?")
.show();
view raw 1. with Image hosted with ❤ by GitHub
new CuteDialog.withIcon(this)
.setIcon(R.mipmap.ic_launcher)
.setTitle("Simple Dialog")
.setDescription("This is a simple Dialog")
.show();
view raw 2. with Icon hosted with ❤ by GitHub
new CuteDialog.withAnimation(this)
.setAnimation(R.raw.anim1)
.setTitle("Set Reminder")
.setDescription("Do you want me to remind you? ")
.show();

collage

( Visit Wiki for more )

More

Thanks for Reading. Have a good day.

Find me on - Github, Facebook

Top comments (0)