QuickAccessState

data class QuickAccessState(val homeAddress: QuickAccessItem? = null, val workAddress: QuickAccessItem? = null, val recentDestinations: List<QuickAccessItem> = emptyList(), val isLoading: Boolean = false)

Represents the current state of quick access destinations.

This data class uses only clean types with no app-side dependencies, making it suitable for inclusion in the MSDK.

State Contents

The state holds three categories of destinations:

Display in Android Auto

When the search query is empty, Android Auto shows quick access items:

┌──────────────────────────────────┐
│ [Search box - empty] │
├──────────────────────────────────┤
│ 🏠 Home │
│ 123 Main Street, City │
├──────────────────────────────────┤
│ 🏢 Work │
│ 456 Business Ave, City │
├──────────────────────────────────┤
│ 🕐 Paris Office │
│ 789 Paris Street, France │
├──────────────────────────────────┤
│ 🕐 Airport Terminal │
│ Airport Road, City │
└──────────────────────────────────┘

Loading State

The isLoading flag indicates when data is being fetched from storage. Android Auto can show a loading indicator during this time.

See also

Constructors

Link copied to clipboard
constructor(homeAddress: QuickAccessItem? = null, workAddress: QuickAccessItem? = null, recentDestinations: List<QuickAccessItem> = emptyList(), isLoading: Boolean = false)

Properties

Link copied to clipboard

The user's home address, null if not set

Link copied to clipboard

Whether quick access data is being loaded from storage

Link copied to clipboard

List of recent destinations, ordered newest first (max 5)

Link copied to clipboard

The user's work address, null if not set

Functions

Link copied to clipboard

Returns all quick access items in display order.

Link copied to clipboard

Checks if there are any quick access items to display.

Link copied to clipboard
fun itemCount(): Int

Returns the total count of quick access items.