MaterialDialogScope
Interface defining values and functions which are available to any code within a MaterialDialog's content parameter
Functions
Link copied to clipboard
Adds a callback to the dialog which is called on positive button press
Link copied to clipboard
abstract fun PositiveButtonEnabled(valid: Boolean, onDispose: () -> Unit)
Content copied to clipboard
Adds a value to the positiveButtonEnabled map and updates the value in the map when valid changes
Properties
Extensions
Link copied to clipboard
Create an view in the dialog with the given content and appropriate padding
Link copied to clipboard
fun MaterialDialogScope.iconTitle( text: String? = null, @StringRes textRes: Int? = null, color: Color = MaterialTheme.colors.onSurface, style: TextStyle = MaterialTheme.typography.h6, icon: @Composable () -> Unit = {})
Content copied to clipboard
Adds a title with the given text and icon to the dialog
Link copied to clipboard
fun MaterialDialogScope.input( modifier: Modifier = Modifier, label: String, placeholder: String = "", prefill: String = "", enabled: Boolean = true, readOnly: Boolean = false, textStyle: TextStyle = LocalTextStyle.current, leadingIcon: @Composable () -> Unit? = null, trailingIcon: @Composable () -> Unit? = null, visualTransformation: VisualTransformation = VisualTransformation.None, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, keyboardActions: KeyboardActions = KeyboardActions(), singleLine: Boolean = false, maxLines: Int = Int.MAX_VALUE, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, colors: TextFieldColors = TextFieldDefaults.textFieldColors(), textFieldStyle: TextFieldStyle = TextFieldStyle.Filled, waitForPositiveButton: Boolean = true, errorMessage: String = "", focusRequester: FocusRequester = FocusRequester.Default, focusOnShow: Boolean = false, isTextValid: (String) -> Boolean = { true }, onInput: (String) -> Unit = {})
Content copied to clipboard
Adds an input field with the given parameters to the dialog
Link copied to clipboard
fun <T> MaterialDialogScope.listItems( modifier: Modifier = Modifier, state: LazyListState = rememberLazyListState(), list: List<T>, closeOnClick: Boolean = true, onClick: (index: Int, item: T) -> Unit = { _, _ -> }, isEnabled: (index: Int) -> Boolean = { _ -> true }, item: @Composable (index: Int, T) -> Unit)
Content copied to clipboard
Adds a selectable list with custom items to the dialog
fun MaterialDialogScope.listItems( list: List<String>, state: LazyListState = rememberLazyListState(), closeOnClick: Boolean = true, onClick: (index: Int, item: String) -> Unit = { _, _ -> })
Content copied to clipboard
Adds a selectable plain text list to the dialog
Link copied to clipboard
fun MaterialDialogScope.listItemsMultiChoice( list: List<String>, state: LazyListState = rememberLazyListState(), disabledIndices: Set<Int> = setOf(), initialSelection: Set<Int> = setOf(), waitForPositiveButton: Boolean = true, onCheckedChange: (indices: Set<Int>) -> Unit = {})
Content copied to clipboard
Adds a multi-choice list view to the dialog
Link copied to clipboard
fun MaterialDialogScope.listItemsSingleChoice( list: List<String>, state: LazyListState = rememberLazyListState(), disabledIndices: Set<Int> = setOf(), initialSelection: Int? = null, waitForPositiveButton: Boolean = true, onChoiceChange: (selected: Int) -> Unit = {})
Content copied to clipboard
Adds a single-choice list view to the dialog