AlertDialogDefaults
object AlertDialogDefaults
Contains the default values used by AlertDialog
Summary
Public functions |
|
|---|---|
Unit |
@ComposableDefault composable for the confirm button in an |
Unit |
@ComposableDefault composable for the dismiss button in an |
Unit |
@ComposableDefault composable for the edge button in an |
Unit |
Separator for the |
PaddingValues |
@ComposableThe padding to apply around the content for the |
PaddingValues |
@ComposableThe padding to apply around the content for the |
PaddingValues |
The padding to apply around the content for the |
PaddingValues |
The padding to apply around the content for the |
PaddingValues |
The padding to apply around the content for the |
PaddingValues |
The padding to apply around the content for the |
Public properties |
|
|---|---|
@Composable RowScope.() -> Unit |
Default icon for the confirm button. |
@Composable RowScope.() -> Unit |
Default icon for the dismiss button. |
Arrangement.Vertical |
Default vertical arrangement for an |
Public functions
ConfirmButton
@Composable
fun ConfirmButton(
onClick: () -> Unit,
modifier: Modifier = Modifier,
colors: IconButtonColors = IconButtonDefaults.filledIconButtonColors(),
content: @Composable RowScope.() -> Unit = ConfirmIcon
): Unit
Default composable for the confirm button in an AlertDialog. Should be used with AlertDialog overload which has 2 button slots to confirm or dismiss the action.
| Parameters | |
|---|---|
onClick: () -> Unit |
The callback to be invoked when the button is clicked. |
modifier: Modifier = Modifier |
The |
colors: IconButtonColors = IconButtonDefaults.filledIconButtonColors() |
The |
content: @Composable RowScope.() -> Unit = ConfirmIcon |
The composable content of the button. Defaults to |
DismissButton
@Composable
fun DismissButton(
onClick: () -> Unit,
modifier: Modifier = Modifier,
colors: IconButtonColors = IconButtonDefaults.filledTonalIconButtonColors(),
content: @Composable RowScope.() -> Unit = DismissIcon
): Unit
Default composable for the dismiss button in an AlertDialog. Should be used with AlertDialog overload which has 2 button slots to confirm or dismiss the action.
| Parameters | |
|---|---|
onClick: () -> Unit |
The callback to be invoked when the button is clicked. |
modifier: Modifier = Modifier |
The |
colors: IconButtonColors = IconButtonDefaults.filledTonalIconButtonColors() |
The |
content: @Composable RowScope.() -> Unit = DismissIcon |
The composable content of the button. Defaults to |
EdgeButton
@Composable
fun EdgeButton(
onClick: () -> Unit,
modifier: Modifier = Modifier,
colors: ButtonColors = ButtonDefaults.buttonColors(),
content: @Composable RowScope.() -> Unit = ConfirmIcon
): Unit
Default composable for the edge button in an AlertDialog. This is a medium sized EdgeButton. Should be used with AlertDialog overload which contains a single edgeButton slot.
| Parameters | |
|---|---|
onClick: () -> Unit |
The callback to be invoked when the button is clicked. |
modifier: Modifier = Modifier |
The |
colors: ButtonColors = ButtonDefaults.buttonColors() |
The |
content: @Composable RowScope.() -> Unit = ConfirmIcon |
The composable content of the button. Defaults to |
GroupSeparator
@Composable
fun GroupSeparator(): Unit
Separator for the AlertDialog. Should be used inside AlertDialog content for splitting groups of elements.
buttonStackContentPadding
@Composable
fun buttonStackContentPadding(isScrollable: Boolean): PaddingValues
The padding to apply around the content for the AlertDialog variation using TransformingLazyColumn, without an icon, and with a stack of buttons for options. Bottom padding is calculated based on the provided isScrollable parameter, which favors the use of a bigger padding for scrollable content and a smaller one for fixed content.
buttonStackWithIconContentPadding
@Composable
fun buttonStackWithIconContentPadding(isScrollable: Boolean): PaddingValues
The padding to apply around the content for the AlertDialog variation using TransformingLazyColumn, with icon, and with a stack of buttons for options. Bottom padding is calculated based on the provided isScrollable parameter, which favors the use of a bigger padding for scrollable content and a smaller one for fixed content.
confirmDismissContentPadding
@Composable
fun confirmDismissContentPadding(): PaddingValues
The padding to apply around the content for the AlertDialog variation with confirm dismiss buttons and no icon content.
confirmDismissWithIconContentPadding
@Composable
fun confirmDismissWithIconContentPadding(): PaddingValues
The padding to apply around the content for the AlertDialog variation when an icon is provided and with confirm dismiss buttons.
contentPadding
@Composable
fun contentPadding(): PaddingValues
The padding to apply around the content for the AlertDialog with either a stack of buttons (no confirm or dismiss buttons) or an EdgeButton, and when there is no icon. For the EdgeButton variation, the bottom padding is ignored.
contentWithIconPadding
@Composable
fun contentWithIconPadding(): PaddingValues
The padding to apply around the content for the AlertDialog with either a stack of buttons (no confirm or dismiss buttons) or an EdgeButton, and when there is an icon. For the EdgeButton variation, the bottom padding is ignored.
Public properties
ConfirmIcon
val ConfirmIcon: @Composable RowScope.() -> Unit
Default icon for the confirm button.
DismissIcon
val DismissIcon: @Composable RowScope.() -> Unit
Default icon for the dismiss button.
VerticalArrangement
val VerticalArrangement: Arrangement.Vertical
Default vertical arrangement for an AlertDialog.