# Hands-on with Material Components for Android: Dialogs

DevFeed: [Hands-on with Material Components for Android: Dialogs](<https://devfeed.tech/articles/hands-on-with-material-components-for-android-dialogs-25994.md>)

Original publisher: [Read original article](<https://medium.com/over-engineering/hands-on-with-material-components-for-android-dialogs-75c6d726f83a?source=rss-37290b859aca------2>)

Author: Nick Rout

Published: 2019-07-29T14:00:13Z

Content type: tutorial

Language: en

Sources: [Stories by Nick Rout on Medium](<https://devfeed.tech/sources/stories-by-nick-rout-on-medium.md>)

Topics: [dialog](<https://devfeed.tech/topics/dialog.md>), [Android](<https://devfeed.tech/topics/android.md>), [material-components](<https://devfeed.tech/topics/material-components.md>), [Material Design](<https://devfeed.tech/topics/material-design.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [dialog](<https://devfeed.tech/tags/dialog.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [material-components](<https://devfeed.tech/tags/material-components.md>), [material-design](<https://devfeed.tech/tags/material-design.md>), [material-theming](<https://devfeed.tech/tags/material-theming.md>)

## AI overview

A practical guide to Material Components for Android dialogs. It explains alert, simple, confirmation, and full-screen dialog types, their shared characteristics, basic implementation with MaterialAlertDialogBuilder, configuration-change behavior, and customization options.

## Source excerpt

Part 7 of a series covering practical usage of Material Components for Android This post will be covering the features and API of Dialog components. To find out how to handle initial setup of Material Components for Android (including the Gradle dependency and creating an app theme), please see my original post: Setting up a Material Components theme for Android Dialogs are components, typically with modal windows, that are displayed in front of app content. They are used to inform users about a task that may contain critical information and/or require a decision. They purposefully interrupt the current flow and remain on screen until dismissed or action has been taken, so they should be used sparingly. From a design perspective, there are three main types of dialogs which can be used in different scenarios: Alert dialog: The simplest of dialogs, despite the name. Used to interrupt a user with urgent information that typically requires user action/confirmation. Characterized by a title, optional supporting text and action buttons. Simple dialog: Used to present the user with a list of actions that, when tapped, take immediate effect. Should not contain action buttons. Confirmation dialog: Used to present a list of single- or multi-select choices to a user. Action buttons serve to confirm the choice(s). All of the above share common characteristics: a background scrim that obscures app content (which can be optionally tapped to dismiss the dialog) and a surface container. Note: A fourth type exists: Full screen dialog. To implement this, the official documentation recommends using a DialogFragment along with resource qualifiers to determine how it is presented. This is outside the scope of this article and won't be covered. Basic usage 🏁 All of the aforementioned dialog types can be implemented using MaterialAlertDialogBuilder. This builder class configures and instantiates an AlertDialog with Material Design specifications and theming. The basic method of showing a