Skip to main content

Configuration API

The Navigation SDK UX Framework's Configuration API allows you to configure various aspects of the experience, such as:

  • Tokens required for services and data access.
  • Data providers, like a location engine.
  • Look-and-feel aspects of the experience, including Map styles, colors and typography.
  • Settings to control whether specific features are available to the users of the application.

To modify UX Framework configuration you will need to:

  1. Build a configuration object with options you would like to modify.
val config = DashConfig.create(
applicationContext = applicationContext,
accessToken = getString(R.string.mapbox_access_token),
) {
themeConfig {
// Set your custom application theme style res for day and night.
}
mapStyleConfig {
// Set your custom map styles.
}
locationEngine = {
// Set your custom location engine.
}
...
}
  1. Initialize Dash object which represents the main entry point to the UX Framework:
Dash.init(config)

After initialization, a subset of available configuration options can also be mutated at any point in the runtime via a configuration update. We are continuously working on enabling more configuration values to be available to update in the runtime.

To update configuration options, use Dash.applyUpdate function or its overrides. For example, you may want to update the Map’s day style depending on the mode your app is in:

Dash.applyUpdate {
mapStyleConfig {
dayStyleUri = "mapbox://styles/<mapbox_account_name>/<style_id>"
}
}

The new style will be applied to the existing configuration at once.

Was this page helpful?