CuteDialog- Android Custom Material Dialog Library

Overview

GitHub forks Cute Dialog

platform API JitPack GitHub license

A Custom Material Design Dialog Library for Android

GitHub issues GitHub forks GitHub stars GitHub contributors Code Size

Build Code Quality CodeFactor


Purpose

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.

Features

feature

Screenshot

Icon Image Animation
icon image animation

Demo

Download and Give it a try.

Prerequisites

Old

If you're using old gradle versions then follow this. Add this in your root build.gradle :

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

New

If you're using new gradle versions then follow this. Add this in your settings.gradle file:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
       ...
        maven { url 'https://jitpack.io' }

    }
}

Theme

For using CuteDialog in your project, you must use Material Theme in your project. You can use CuteDialog in both Material Light and Dark theme.

For example:

   <style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
       
       <!-- Customize your theme here. -->
       
   </style>

Or

    <style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
	    
        <!-- Customize your theme here. -->
	    
    </style>

Dependencies

Add this to your app level build.gradle:

(Always use the latest version. Current Latest version is JitPack )

dependencies {
	...
	       implementation 'com.github.CuteLibs:CuteDialog:v-1.1'


}

Usage

Basic

            new CuteDialog(this)
                    .setHeader(CuteDialog.HEADER_ICON)
                    .setHeaderIcon(R.drawable.icon_1)
                    .setTitle("Wrong Time", 0, 0, 0)
                    .setDesc("You can't do this right now.\nTry Later", 0, 0, 0)
		    .setPositiveButtonListener(v1 -> {
                        Toast.makeText(this, "Positive Button Clicked", Toast.LENGTH_SHORT).show();
                    }) 
                    .setNegativeButtonListener(v12 -> {
                        Toast.makeText(this, "Negative Button Clicked", Toast.LENGTH_SHORT).show();
                    }) 
                    .show();

Advanced

            new CuteDialog(this)
                    .setDialogStyle(Color.WHITE,10,CuteDialog.POSITION_CENTER,10) // Whole Dialog Style
                    .isCancelable(true) // Dialog Cancelable when clicked outside
                    .setCloseIconStyle(0,30,Color.DKGRAY) // Close Icon Style
                    .setHeader(CuteDialog.HEADER_IMAGE) // Header Type
                    .setHeaderImage(R.drawable.image_4) // Image Header 
                    .setTitle("Something is Wrong", 0, Color.parseColor("#673AB7"), 0) // Title with Design
                    .setDesc("I don't know what went wrong, but there is a problem.", 0, 0, 0) // Description with Design
                    .setPositiveButtonText("Try Again",  Color.parseColor("#673AB7"), 0) // Positive Button Text with Design
                    .setNegativeButtonText("Cancel",  Color.parseColor("#673AB7"), 0) // Negative Button Text with Design
                    .setPositiveButtonStyle(0, Color.parseColor("#673AB7"), 0, 0, 0) // Positive Button Style
                    .setNegativeButtonStyle(0, 0, Color.parseColor("#673AB7"), 0, 0) // Negative Button Style 
                    .setPositiveButtonListener(v1 -> {
                        Toast.makeText(this, "Positive Button Clicked", Toast.LENGTH_SHORT).show();
                    }) // Positive Button Click Listener
                    .setNegativeButtonListener(v12 -> {
                        Toast.makeText(this, "Negative Button Clicked", Toast.LENGTH_SHORT).show();
                    }) // Negative Button click Listener
                    .setCloseListener(v13 -> {
                        Toast.makeText(this, "Close Icon Clicked", Toast.LENGTH_SHORT).show();
                    }) // Close Icon click Listener
                    .show();

Customizations

Notes

  • setHeader - it's a custom field to choose which type of header you want to use. Details at Attributes/Enums
  • setHeaderIcon - used to choose a icon, basically drawable/mipmap. Example, R.drawable.icon / R.mipmap.ic_launcher
  • setHeaderImage - used to choose a image, basically drawable. Example, R.drawable.image
  • setHeaderAnimation - used to choose a animation from 'res/raw' folder. Example, R.raw.anim. Animtaion is shown using Lottie for Android library.

customizations

Attributes

Attributes

Keyword Values
setDialogStyle int bgColor, int cornerRadius, int dialogPosition, int padding
isCancelable boolean cancelable
setCloseIconStyle int iconResID, int sizeInDP, int colorOfIcon
setHeader int chooser
setHeaderIcon int icon
setHeaderImage int image
setHeaderAnimation int animation
setTitle String titleText, int textSizeInSP, int textColor, int textStyle
setDesc String descText, int textSizeInSP, int textColor, int textStyle
setPositiveButtonStyle int radiusOfButton, int bgColorOfButton, int borderColor, int borderWidth, int textSizeInSP
setNegativeButtonStyle int radiusOfButton, int bgColorOfButton, int borderColor, int borderWidth, int textSizeInSP
setPositiveButtonText String positiveText, int textColor, int textStyle
setNegativeButtonText String negativeText, int textColor, int textStyle
setVisibilityOptions boolean hideCloseIcon, boolean hideTitle, boolean hideDesc, boolean hidePositiveButton, boolean hideNegativeButton
setPositiveButtonListener View.OnClickListener listener
setNegativeButtonListener View.OnClickListener listener
setCloseListener View.OnClickListener listener
show()

Enums

Usage Keyword Value
Dialog Position POSITION_CENTER 1
Dialog Position POSITION_TOP 2
Dialog Position POSITION_BOTTOM 3
Text Style STYLE_NORMAL 1
Text Style STYLE_BOLD 2
Text Style STYLE_ITALIC 3
Text Style STYLE_BOLD_ITALIC 4
Header Styler HEADER_ICON 1
Header Styler HEADER_IMAGE 2
Header Styler HEADER_ANIMATION 3

More Demo

collage

Contribute

Please fork this repository and contribute back using pull requests.

Any contributions, large or small, major features, bug fixes, are welcomed and appreciated.

Let me know which features you want in the future in Request Feature tab.

If this project helps you a little bit, then give a to Star the Repo.

Credits

Created with ❤️ by CuteLibs & K M Rejowan Ahmmed

License

Copyright 2022 CuteLibs

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

You might also like...
Android library to show
Android library to show "Rate this app" dialog

Android-RateThisApp Android-RateThisApp is an library to show "Rate this app" dialog. The library monitors the following status How many times is the

Android library that allows applications to add dialog-based slider widgets to their settings
Android library that allows applications to add dialog-based slider widgets to their settings

Android Slider Preference Library Overview Slider represents a float between 0.0 and 1.0 Access with SliderPreference.getValue() or SharedPreferences.

An Android library for displaying a dialog where it presents new features in the app.
An Android library for displaying a dialog where it presents new features in the app.

WhatIsNewDialog What is new dialog for Android is used for presenting new features in the the app. It can be used in the activity starts, from menu or

Android library to show
Android library to show "Rate this app" dialog

Android-RateThisApp Android-RateThisApp is an library to show "Rate this app" dialog. The library monitors the following status How many times is the

An beautiful and easy to use dialog library for Android
An beautiful and easy to use dialog library for Android

An beautiful and easy to use dialog library for Android

Advanced dialog solution for android
Advanced dialog solution for android

DialogPlus Simple and advanced dialog solution. Uses normal view as dialog Provides expandable option Multiple positioning Built-in options for easy i

SweetAlert for Android, a beautiful and clever alert dialog
SweetAlert for Android, a beautiful and clever alert dialog

Sweet Alert Dialog SweetAlert for Android, a beautiful and clever alert dialog 中文版 Inspired by JavaScript SweetAlert Demo Download ScreenShot Setup Th

An Android Dialog Lib simplify customization.
An Android Dialog Lib simplify customization.

FlycoDialog-Master 中文版 An Android Dialog Lib simplify customization. Supprot 2.2+. Features [Built-in Dialog, convenient to use](#Built-in Dialog) [Ab

A simple file/ directory picker dialog for android
A simple file/ directory picker dialog for android

FileListerDialog FileListerDialog helps you to list and pick file/directory. Library is built for Android Getting Started Installing To use this libra

Comments
  • Simplify Usage

    Simplify Usage

    Is your feature request related to a problem? Please describe. Simplify usage codes

    Describe the solution you'd like Customization part is complex to understand, simplifying will help others to undertand

    opened by ahmmedrejowan 1
  • [ImgBot] Optimize images

    [ImgBot] Optimize images

    Beep boop. Your images are optimized!

    Your image file size has been reduced by 21% 🎉

    Details

    | File | Before | After | Percent reduction | |:--|:--|:--|:--| | /files/shot3.gif | 153.56kb | 75.32kb | 50.95% | | /files/feature.jpg | 118.04kb | 96.92kb | 17.89% | | /files/details.jpg | 128.62kb | 107.13kb | 16.70% | | /files/shot1.png | 35.26kb | 30.53kb | 13.41% | | /files/shot2.png | 67.77kb | 59.58kb | 12.08% | | /files/collage.jpg | 208.99kb | 186.50kb | 10.76% | | /files/library_icon.png | 14.29kb | 13.23kb | 7.46% | | /files/Cute_Dialog.png | 23.93kb | 22.80kb | 4.72% | | | | | | | Total : | 750.45kb | 592.02kb | 21.11% |


    📝 docs | :octocat: repo | 🙋🏾 issues | 🏪 marketplace

    ~Imgbot - Part of Optimole family

    opened by imgbot[bot] 1
  • Fix 2 Maintainability issues in .github\workflows\android.yml

    Fix 2 Maintainability issues in .github\workflows\android.yml

    opened by ahmmedrejowan 0
Releases(2.1)
Owner
CuteLibs - Smart & Beautiful Android Libraries
CuteLibs - Smart & Beautiful Android Libraries
Android has a built in microphone through which you can capture audio and store it , or play it in your phone. There are many ways to do that but with this dialog you can do all thats with only one dialog.

# Media Recorder Dialog ![](https://img.shields.io/badge/Platform-Android-brightgreen.svg) ![](https://img.shields.io/badge/Android-CustomView-blue.sv

Abdullah Alhazmy 73 Nov 29, 2022
[Deprecated] This project can make it easy to theme and custom Android's dialog. Also provides Holo and Material themes for old devices.

Deprecated Please use android.support.v7.app.AlertDialog of support-v7. AlertDialogPro Why AlertDialogPro? Theming Android's AlertDialog is not an eas

Feng Dai 468 Nov 10, 2022
ionalert 1.3 1.6 Java Sweetalert, Dialog, Alert Dialog

ionalert - Android Alert Dialog A beautiful design Android Alert Dialog, alternative of Sweet Alert Dialog based on KAlertDialog using MaterialCompone

Excel Dwi Oktavianto 23 Sep 17, 2022
Alert Dialog - You can use this extension instead of creating a separate Alert Dialog for each Activity or Fragment.

We show a warning message (Alert Dialog) to the user in many parts of our applications. You can use this extension instead of creating a separate Alert Dialog for each Activity or Fragment. Thanks to this extension, you can create a Dialog and call it in the Activity or Fragment you want and customize the component you want.

Gökmen Bayram 0 Jan 9, 2022
Extremely useful library to validate EditText inputs whether by using just the validator for your custom view or using library's extremely resizable & customisable dialog

Extremely useful library for validating EditText inputs whether by using just the validator (OtpinVerification) for your custom view or using library's extremely resizable & customisable dialog (OtpinDialogCreator)

Ehma Ugbogo 17 Oct 25, 2022
A simple library to show custom dialog with animation in android

SmartDialog A simple library to show custom dialog in android Step 1. Add the JitPack repository to your build file allprojects { repositories {

claudysoft 9 Aug 18, 2022
a quick custom android dialog project

QustomDialog Qustom helps you make quick custom dialogs for Android. All this is, for the time being, is a way to make it easy to achieve the Holo loo

Daniel Smith 183 Nov 20, 2022
Custom Dialog

Custom Dialog use Lottie Dialog How To Use? If yow want specific lottie file you must put your assets to under app → src → main → assets folder Add li

DevHoony 16 Oct 10, 2022
AlertDialog for Android, a beautiful and material alert dialog to use in your android app.

AlertDialog for Android, a beautiful and material alert dialog to use in your android app. Older verion of this library has been removed

Akshay Masram 124 Dec 28, 2022
A Material Dialog Builder for Jetpack Compose

Compose Material Dialogs ?? Easy to use library to help you build complex dialogs using Jetpack Compose ?? Current Library Compose Version: 1.1.1 See

Pranav Maganti 433 Dec 31, 2022