Aesthetic Dialogs for Android: A Guide to Beautiful Custom Dialogs

May 14, 2022 | Programming

Welcome to the enchanting world of Aesthetic Dialogs, an Android library where fluidity meets beauty to deliver custom dialogs that elevate your application’s user experience. Let’s embark on a journey to infuse aesthetic charm into your Android projects!

Table of Contents

Introduction

The AestheticDialogs library offers a suite of visually stunning and customizable dialogs inspired by Laravel Notify. These dialogs are designed to provide a smooth user experience while ensuring that the aesthetic appeal of your app is maintained.

Types of Dialog

As of now, the library includes eight distinct types of dialogs that you can utilize:

1. Flash Dialog 2. Connectify Dialog 3. Toaster Dialog
Flash Dialog Connectify Dialog Toaster Dialog
4. Emotion Dialog 5. Drake Dialog 6. Emoji Dialog
Emotion Dialog Drake Dialog Emoji Dialog
7. Rainbow Dialog 8. Flat Dialog
Rainbow Dialog Flat Dialog

Dark Theme

AestheticDialogs also provides a beautiful dark theme for some of the dialogs, enhancing the visual experience and making it easier on the eyes in low-light settings.

1. Connectify Dark Dialog 2. Toaster Dark Dialog 3. Emoji Dark Dialog
Connectify Dark Dialog Toaster Dark Dialog Emoji Dark Dialog
4. Flat Dark Dialog Let’s Use Aesthetic Dialog!
Flat Dark Dialog Aesthetic Dialog Presentation

Implementation

Implementing Aesthetic Dialogs is straightforward. You can explore the demo in the app directory. Here’s how to get started:

Prerequisite

  • Gradle: Add the JitPack repository to your root build.gradle file:
  • allprojects {
        repositories {
            ...
            maven {
                url 'https://jitpack.io'
            }
        }
    }
  • Next, add the dependency to your app-level build.gradle:
  • dependencies {
        ...
        implementation 'com.github.gabriel-TheCode:AestheticDialogs:1.3.8'
    }

Create Dialog

You can create multiple dialogs by specifying the style, type, and animation of the alert you wish to display. Let’s say creating a dialog is like preparing a unique dish; you choose the ingredients (style), the cuisine (type), and how you want it served (animation). For example:

 // Example 1: Flat Dialog
AestheticDialog.Builder(this, DialogStyle.FLAT, DialogType.SUCCESS)
    .setTitle("Title")
    .setMessage("Message")
    .setCancelable(false)
    .setDarkMode(true)
    .setGravity(Gravity.CENTER)
    .setAnimation(DialogAnimation.SHRINK)
    .setOnClickListener(object : OnDialogClickListener {
        override fun onClick(dialog: AestheticDialog.Builder) {
            dialog.dismiss()
            // actions...
        }
    })
    .show()

// Example 2: Emotion Dialog
AestheticDialog.Builder(this, DialogStyle.EMOTION, DialogType.ERROR)
    .setTitle("Title")
    .setMessage("Message")
    .show()

The above code shows how to prepare dialogs in your app. You also have optional methods to further customize them:

  • setCancelable()
  • setDarkMode()
  • setDuration()
  • setGravity()
  • setAnimation()

Demo

If you want to see Aesthetic Dialogs in action, you can download the demo app from the Play Store.

Contribute

We encourage collaboration and contributions! If you have suggestions or improvements, feel free to raise issues and open pull requests. Make sure to review our Contributing Guidelines before submitting.

Credits

This library leverages several open-source libraries, prominently including Material Components for Android.

License

This project is licensed under the Apache License, Version 2.0.

Troubleshooting

If you encounter any issues while implementing Aesthetic Dialogs, consider the following troubleshooting ideas:

  • Ensure you have added the JitPack repository in your Gradle files correctly.
  • Check for any incompatible dependencies that may affect the library’s functionality.
  • Make sure your Android API level meets the requirements specified in the documentation.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox