Package-level declarations

Types

Link copied to clipboard
data class Step(    val actionControls: @Composable () -> Unit? = null,     val initiallyExpanded: Boolean = false,     val enabled: MutableState<Boolean>? = null,     val stepIcon: ImageVector,     val title: StringResource,     val content: @Composable ColumnScope.() -> Unit,     val isError: MutableState<Boolean>? = null,     val dismissAction: (MutableState<Boolean>) -> Unit? = null,     val dismissIcon: ImageVector = Icons.Default.Cancel,     val confirmAction: (MutableState<Boolean>) -> Unit = { it.value = false },     val confirmIcon: ImageVector = Icons.Default.CheckCircle)

The information related to a single step to represent in the Stepper component

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class StepContent(val number: Int, val enabledWhen: String = "")

The StepContent annotation is used to mark the methods which are the content of a step of the Stepper component. It indicates the number of step and whether the step is enabled in specific scenarios.

Functions

Link copied to clipboard
private fun ActionControls(    expandsStepIcon: ImageVector,     expanded: MutableState<Boolean>,     dismissAction: (MutableState<Boolean>) -> Unit?,     dismissIcon: ImageVector,     dismissButtonColor: Color,     confirmAction: (MutableState<Boolean>) -> Unit,     confirmIcon: ImageVector,     confirmColor: Color)

The action controls section to manage the StepAction

Link copied to clipboard
private fun Array<out Step>.findSpecialIndex(    invalidSpecialIndex: Int = 0,     elementToCheck: Step,     defaultIndexValue: Int,     onAssign: (Int) -> Int = { it }): Int

Method used to find the value of a special index

Link copied to clipboard
private fun Step.isEnabled(): Boolean

Scoped function used to check whether a Step depends on a special condition to be enabled

Link copied to clipboard
private fun Array<out Step>.mapSpecialIndexes(): Pair<Int, Int>

Method used to map the special indexes of the steps lit of the Stepper component. The special indexes are those indexes near to Step which its enabling depends on a state

Link copied to clipboard
private fun StepAction(    shape: Shape,     errorColor: Color,     confirmColor: Color,     stepBackgroundColor: Color,     expandsStepIcon: ImageVector,     step: Step,     bottomDivider: Boolean = true)

Section dedicated to a single Step

Link copied to clipboard
fun Stepper(    containerModifier: Modifier = Modifier,     stepperModifier: Modifier = Modifier,     headerSection: @Composable () -> Unit? = null,     startStepShape: Shape = RoundedCornerShape( topStart = 12.dp, topEnd = 12.dp ),     middleStepShape: Shape = RectangleShape,     finalStepShape: Shape = RoundedCornerShape( bottomStart = 12.dp, bottomEnd = 12.dp ),     stepBackgroundColor: Color = MaterialTheme.colorScheme.surfaceContainerHighest,     errorColor: Color = MaterialTheme.colorScheme.error,     confirmColor: Color = MaterialTheme.colorScheme.primary,     expandsStepIcon: ImageVector = Icons.AutoMirrored.Filled.KeyboardArrowRight,     vararg steps: Step)

This component allows to create a dynamic interaction with the user dividing for example a long procedure such item creation, customization, etc... in different specific steps where the user can interact.