fun RouteEditorComposable(viewModel: RouteEditorViewModel, modifier: Modifier = Modifier, colors: RouteEditorComposableColors = RouteEditorComposableColors.colors(), textStyles: RouteEditorTextStyles = RouteEditorTextStyles.default, routeCard: @Composable (routeUiInfo: RouteUiInfo, isExpanded: Boolean, onCardClick: () -> Unit, onActionButtonClick: () -> Unit) -> Unit = { routeUiInfo, isExpanded, onCardClick, onActionButtonClick ->
RouteCard(
routeUiInfo = routeUiInfo,
modifier = Modifier,
isExpanded = isExpanded,
onCardClick = onCardClick,
colors = colors.routeCardColors,
textStyles = textStyles,
onActionButtonClick = onActionButtonClick,
)
}, noRoutesCard: @Composable (onActionButtonClick: () -> Unit) -> Unit = { onActionButtonClick ->
NoRoutesCard(
onActionButtonClick = onActionButtonClick,
colors = colors.routeErrorColors,
)
}, routePointsDisplay: @Composable (startPointTitle: String, destinationPointTitle: String, intermediatePoints: List<UiIntermediateRoutePoint>, onSwapDestinationsClick: () -> Unit, onCloseButtonClick: () -> Unit, onIntermediatePointsChanged: (List<UiIntermediateRoutePoint>) -> Unit) -> Unit = {
startPointTitle,
destinationPointTitle,
intermediatePoints,
onSwapDestinationsClick,
onCloseButtonClick,
onIntermediatePointsChanged,
->
RoutePointsDisplay(
startPointTitle = startPointTitle,
destinationPointTitle = destinationPointTitle,
intermediatePoints = intermediatePoints,
onSwapDestinationsClick = onSwapDestinationsClick,
onCloseClick = onCloseButtonClick,
onIntermediatePointsChanged = onIntermediatePointsChanged,
colors = colors.routePointsDisplayColors,
textStyles = textStyles,
)
}, transportationModesRow: @Composable (modifier: Modifier, selectedMode: TransportMode, onModeSelected: (TransportMode) -> Unit, durations: Map<TransportMode, Duration?>, allowedTransportTypes: EnumSet<TransportMode>) -> Unit = { localModifier, selectedMode, onModeSelected, durations, allowedTransportTypes ->
TransportationModesRow(
modifier = localModifier,
selectedMode = selectedMode,
onModeSelected = onModeSelected,
durations = durations,
allowedTransportTypes = allowedTransportTypes,
colors = colors.transportationModesColors,
textStyles = textStyles,
)
}, onCloseClick: () -> Unit = {}) Navigation bottom sheet content that matches the Figma design This is the content that goes inside the ThreeStateBottomSheet
Parameters
The route editor view model
Modifier for the composable
Color scheme for the route editor components
Text styles for the route editor components
Custom route card composable. If not provided, the default RouteCard will be used. The lambda receives all parameters that RouteCard accepts.
Custom composable that displays a card when no routes are available. If not provided, the default NoRoutesCard will be used. The lambda receives all parameters that NoRoutesCard accepts.
Custom route points display composable. If not provided, the default RoutePointsDisplay will be used. The lambda receives route point data and callbacks for interaction.
Custom transportation modes row composable. If not provided, the default TransportationModesRow will be used. The lambda receives transport mode data, selection callback, and a modifier for positioning.
Callback invoked when the close button is clicked. Works with the default route points display.