Package-level declarations

Types

Link copied to clipboard
class BriefRouteDurationProvider(trafficRouter: TrafficRouter, coroutineDispatcher: CoroutineDispatcher = Dispatchers.IO)

Provider for fetching ETA (Estimated Time of Arrival) for different transport modes using brief route information.

Link copied to clipboard
class DefaultRouteEditorViewModel(val routeEditor: RouteEditor, val allowedTransportTypes: EnumSet<TransportMode> = EnumSet.allOf(TransportMode::class.java), val briefRouteDurationProvider: BriefRouteDurationProvider? = null, val routeSearchOptionsProvider: RouteSearchOptionsProvider = DefaultRouteSearchOptionsProvider, val onStartNavigation: (TrafficRoute, RouteBuildOptions) -> Unit = { _, _ -> }) : RouteEditorViewModel, Closeable
Link copied to clipboard

Default implementation of RouteSearchOptionsProvider that uses standard SDK options for all transport modes.

Link copied to clipboard

Types of route features with associated visual properties and priority Priority order matches the design specification from highest to lowest

Link copied to clipboard
data class RouteCardColors(val cardBackground: Color = RouteEditorColors.SurfaceWhite, val primaryText: Color = RouteEditorColors.PrimaryText, val secondaryText: Color = RouteEditorColors.SecondaryText, val buttonBackground: Color = RouteEditorColors.Primary, val buttonText: Color = RouteEditorColors.SurfaceWhite)

Color scheme for route cards

Link copied to clipboard

Dimensions for route card components

Link copied to clipboard

Brand colors used throughout the application

Link copied to clipboard
data class RouteEditorComposableColors(val routePointsDisplayColors: RoutePointsDisplayColors, val transportationModesColors: TransportationModesColors, val routeCardColors: RouteCardColors, val bottomSheetSurfaceColor: Color)

Aggregated colors for the RouteEditorComposable and its children

Link copied to clipboard
data class RouteEditorTextStyles(val Primary: TextStyle = TextStyle( fontSize = 19.sp, fontWeight = FontWeight.Medium, // 500 color = RouteEditorColors.PrimaryText, ), val Secondary: TextStyle = TextStyle( fontSize = 15.sp, fontWeight = FontWeight.Normal, // 400 color = RouteEditorColors.SecondaryText, ), val ETA: TextStyle = TextStyle( fontSize = 14.sp, fontWeight = FontWeight.Medium, color = RouteEditorColors.PrimaryText, ))

Brand text styles with consistent typography

Link copied to clipboard
data class RouteEditorUiState(val startPointTitle: String = "--", val destinationPointTitle: String = "--", val routes: List<RouteUiInfo> = emptyList(), val selectedTransportMode: TransportMode = TransportMode.CAR, val selectedRouteIndex: Long? = null, val intermediatePoints: List<UiIntermediateRoutePoint> = emptyList(), val durations: Map<TransportMode, Duration?> = emptyMap(), val allowedTransportTypes: EnumSet<TransportMode> = EnumSet.allOf(TransportMode::class.java))
Link copied to clipboard

ViewModel for managing route planning and editing functionality.

Link copied to clipboard
data class RouteFeature(val type: FeatureType, val quantity: Int? = null)

Represents a feature or attribute of a route (e.g., traffic, tolls, accidents, road conditions)

Link copied to clipboard
data class RoutePointsDisplayColors(val background: Color = RouteEditorColors.SurfaceWhite, val surfaceWhite: Color = RouteEditorColors.SurfaceWhite, val listBackground: Color = Color(0xFFF5F5F5), val divider: Color = Color(0xFFE0E0E0), val draggingBackground: Color = Color(0xFFEEEEEE), val primaryGreen: Color = RouteEditorColors.Primary, val primaryText: Color = Color.Black, val secondaryText: Color = Color.Gray, val startPointIcon: Color = RouteEditorColors.Primary, val endPointIcon: Color = RouteEditorColors.Accent, val intermediatePointIcon: Color = RouteEditorColors.Accent, val removeButtonTint: Color = RouteEditorColors.IconFill, val dragHandleTint: Color = Color.Gray, val verticalConnector: Color = Color(0xFFDDDDDD), val iconBackground: Color = RouteEditorColors.IconBackground)
Link copied to clipboard

Provider interface for creating route search options for different transport modes. Each method has a default implementation that can be overridden to customize routing behavior for specific transport modes.

Link copied to clipboard
data class RouteUiInfo(val duration: Duration, val distanceMeters: Int, @StringRes val descriptionRes: Int, val features: List<RouteFeature> = emptyList())

Data class representing route information

Link copied to clipboard
data class RouteUiPoint(val routeSearchPoint: RouteSearchPoint, val label: String? = null)

Represents a route point with an optional custom label for display in the UI.

Link copied to clipboard
data class TransportationModesColors(val background: Color = RouteEditorColors.BackgroundGrey, val selectedItemBackground: Color = RouteEditorColors.SurfaceWhite, val unselectedItemBackground: Color = Color.Transparent, val selectedIconTint: Color = RouteEditorTextStyles.default.Primary.color, val unselectedIconTint: Color = RouteEditorTextStyles.default.Secondary.color, val selectedTextColor: Color = RouteEditorTextStyles.default.Primary.color, val unselectedTextColor: Color = RouteEditorTextStyles.default.Secondary.color, val selectedTransportTypeBorderColor: Color = RouteEditorColors.Primary)

Color scheme for transportation modes components

Link copied to clipboard

Transportation mode options with drawable resources

Link copied to clipboard
data class UiIntermediateRoutePoint(val title: String, val idx: Int)

Functions

Link copied to clipboard
@Preview(name = "Expanded - Dark", showBackground = true, heightDp = 600, uiMode = 32)
fun ExpandedRoutePointsDarkPreview()
Link copied to clipboard
@Preview(name = "Expanded - Light", showBackground = true, heightDp = 600)
fun ExpandedRoutePointsLightPreview()
Link copied to clipboard
fun RouteCard(routeUiInfo: RouteUiInfo, modifier: Modifier = Modifier, isExpanded: Boolean = false, colors: RouteCardColors = RouteCardColors.colors(), textStyles: RouteEditorTextStyles = RouteEditorTextStyles.default, onCardClick: () -> Unit = {}, onActionButtonClick: () -> Unit = {})

Individual route card component that displays route information

Link copied to clipboard
@Preview(showBackground = true, name = "Collapsed (1 line) - Route Cards")
fun RouteCardCollapsedPreview()
Link copied to clipboard
@Preview(showBackground = true, backgroundColor = 4280032286, name = "Dark - Collapsed (1 line)")
fun RouteCardDarkCollapsedPreview()
Link copied to clipboard
@Preview(showBackground = true, backgroundColor = 4280032286, name = "Dark - Expanded (2 lines)")
fun RouteCardDarkExpandedPreview()
Link copied to clipboard
@Preview(showBackground = true, backgroundColor = 4280032286, name = "Dark - Mixed States")
fun RouteCardDarkMixedPreview()
Link copied to clipboard
@Preview(showBackground = true, name = "Expanded (2 lines) - Route Cards")
fun RouteCardExpandedPreview()
Link copied to clipboard
@Preview(showBackground = true, name = "Mixed States - Route Cards")
fun RouteCardPreview()
Link copied to clipboard
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, ) }, 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

Link copied to clipboard
@Preview(showBackground = true, heightDp = 400)
fun RouteEditorComposablePreview()
Link copied to clipboard
fun RoutePointsDisplay(startPointTitle: String, destinationPointTitle: String, modifier: Modifier = Modifier, colors: RoutePointsDisplayColors = RoutePointsDisplayColors.colors(), textStyles: RouteEditorTextStyles = RouteEditorTextStyles.default, routeDuration: String? = null, intermediatePoints: List<UiIntermediateRoutePoint> = emptyList(), onIntermediatePointsChanged: (List<UiIntermediateRoutePoint>) -> Unit = {}, onSwapDestinationsClick: () -> Unit = {}, onCloseClick: () -> Unit = {})

Component that displays start and destination points with interchange and close functionality

Link copied to clipboard
@Preview(name = "Custom Colors", showBackground = true)
fun RoutePointsDisplayCustomColorsPreview()
Link copied to clipboard
@Preview(name = "Dark Theme", showBackground = true, uiMode = 32)
fun RoutePointsDisplayDarkPreview()
Link copied to clipboard
@Preview(name = "Light Theme", showBackground = true)
fun RoutePointsDisplayLightPreview()
Link copied to clipboard
@Preview(showBackground = true)
fun ThreeStateBottomSheetPreview()
Link copied to clipboard
fun TransportationModesRow(selectedMode: TransportMode, onModeSelected: (TransportMode) -> Unit, durations: Map<TransportMode, Duration?>, allowedTransportTypes: EnumSet<TransportMode>, modifier: Modifier = Modifier, colors: TransportationModesColors = TransportationModesColors.defaultLight(), textStyles: RouteEditorTextStyles = RouteEditorTextStyles.default)

Transportation modes row component

Link copied to clipboard
@Preview(showBackground = true, name = "Light - All Modes - Car Selected")
fun TransportationModesRowAllModesCarPreview()
@Preview(showBackground = true, name = "Light - All Modes - Public Transport Selected")
fun TransportationModesRowAllModesPublicTransportPreview()
@Preview(showBackground = true, backgroundColor = 4280032286, name = "Dark - All Modes - Car Selected")
fun TransportationModesRowDarkAllModesPreview()
Link copied to clipboard
@Preview(showBackground = true, backgroundColor = 4280032286, name = "Dark - Bicycle Selected")
fun TransportationModesRowDarkBicyclePreview()
Link copied to clipboard
@Preview(showBackground = true, backgroundColor = 4280032286, name = "Dark - Loading State")
fun TransportationModesRowDarkLoadingPreview()
@Preview(showBackground = true, backgroundColor = 4280032286, name = "Dark - Public Transport Selected")
fun TransportationModesRowDarkPublicTransportPreview()
Link copied to clipboard
@Preview(showBackground = true, name = "Light - Loading State")
fun TransportationModesRowLoadingPreview()
@Preview(showBackground = true, name = "Light - Mixed Durations (Some Loading)")
fun TransportationModesRowMixedDurationsPreview()
Link copied to clipboard
@Preview(showBackground = true, name = "Light - Pedestrian Selected")
fun TransportationModesRowPedestrianPreview()
Link copied to clipboard
@Preview(showBackground = true, name = "Edge Case - Single Mode")
fun TransportationModesRowSingleModePreview()
Link copied to clipboard
@Preview(showBackground = true, name = "Light - Subset of Modes")
fun TransportationModesRowSubsetPreview()
Link copied to clipboard
@Preview(showBackground = true, name = "Edge Case - Two Modes Only")
fun TransportationModesRowTwoModesPreview()
Link copied to clipboard
fun TransportModeItem(mode: TransportMode, isSelected: Boolean, onClick: () -> Unit, eta: String, modifier: Modifier = Modifier, colors: TransportationModesColors = TransportationModesColors.colors(), textStyles: RouteEditorTextStyles = RouteEditorTextStyles.default)

Transportation mode selector item