Navigation Style and Theme
This section of the Android Navigation SDK guide discusses the process of customizing the Style and Theme to suit the unique branding and visual identity of the application. It covers a range of topics, such as attributes, Navigation View anatomy, attribute-to-UI mapping, and customization of styles, colors, and icons to create a unique and personalized experience for users.
Attributes
This is a list of attributes that can be used to customize the appearance of a navigation view in an application that utilizes the NextBillion.ai Navigation SDK. Each attribute has a unique number, name, and type. The attributes are organized into six groups:
-
Navigation View: The Navigation View attributes allow developers to customize the primary and secondary colors, text color and accent color.
-
Instruction List: Instruction List attributes allow developers to customize the background color, primary and secondary text color and primary and secondary maneuver color.
-
Banner: Banner attributes allow developers to customize the background color, secondary background color, primary and secondary text color, primary and secondary maneuver color.
-
Sound button: Sound button attributes allow developers to customize the color and background color of the sound button.
-
Speedometer: Speedometer attributes allow developers to customize the background color, text color and unit text color of the speedometer.
-
Others: Other attributes allow developers to customize the appearance of the destination marker, route overview, recenter background, recenter info color, user location style, route style, and map style.
To learn more about attributes in Android, please refer to the Android official docs: Styles and Themes and Create a view class.
- Navigation View: The Navigation View attributes allow developers to customize the primary and secondary colors, text color and accent color.
- Instruction List: Instruction List attributes allow developers to customize the background color, primary and secondary text color and primary and secondary maneuver color.
- Banner: Banner attributes allow developers to customize the background color, secondary background color, primary and secondary text color, primary and secondary maneuver color.
- Sound button: Sound button attributes allow developers to customize the color and background color of the sound button.
- Speedometer: Speedometer attributes allow developers to customize the background color, text color and unit text color of the speedometer.
- Others: Other attributes allow developers to customize the appearance of the destination marker, route overview, recenter background, recenter info color, user location style, route style, and map style.
To learn more about attributes in Android, please refer to the Android official docs: Styles and Themes and Create a view class. These attributes give developers a high degree of control over the appearance of the navigation view, enabling them to create a visually pleasing and user-friendly navigation experience that is fully consistent with the branding and design of their application.
Anatomy of the Navigation View
This is an anatomy of the Navigation View in an application that utilizes the NextBillion.ai Navigation SDK. The navigation view is broken down into several components, each of which can be customized using specific attributes. These attributes are organized into groups such as Banner, Bottom Summary, Recenter button, Sound button, Route line, Destination Marker, User location, Instruction list, Map Style and Speedometer. Each component has a unique number, example, and description.
For example, the Banner component, which displays the current step and maneuver, can be customized using attributes such as navViewBannerBackground, navViewBannerPrimaryText, navViewBannerManeuverPrimary and navViewBannerSecondaryText.
The Bottom Summary component, which displays the remaining time and distance, can be customized using attributes such as navViewPrimary, navViewRouteOverviewBackground, and navViewSecondaryText. The Recenter button component can be customized using the navigationViewReCentreInfoColor attribute. The Sound button component can be customized using attributes such as navViewSoundColor, navViewSoundBackgroundColor, navViewSoundColor and navViewSoundColor. The Route line component can be customized using attributes such as navViewRouteStyle, routeColor, routeShieldColor and routeScale.
The Destination Marker, User location, Instruction list, Map Style and Speedometer components can also be customized using specific attributes. To understand what and how we can modify in the navigation view, let’s break it down into pieces:

These attributes give developers a high degree of control over the appearance of the navigation view, enabling them to create a visually pleasing and user-friendly
Mapping between attributes and UI
This is a mapping between attributes and the User Interface (UI) of NavigationView. The table lists various attributes and their corresponding UI components that they affect. For example, the attribute navViewPrimary is used to customize the background color of the Bottom Summary, Sound button and the attribute navViewSecondary is used to customize the Sound button text.
Use this mapping table to quickly identify which theme attribute controls each UI area.
navViewRouteStyle
Use NavigationMapRoute style to configure route colors, congestion colors, arrow colors, scales, and line cap behavior.
we can categorize the attributes into these groups:
-
Primary route line
-
alternative route line
-
dashed route line
-
dissolved route line
-
wayname chip
-
waypoint drawables
-
Route scales
-
maneuver arrow
-
line cap
-
off route dot
A minimum example as below:
navViewUserLocationStyle
Use nbmap_LocationComponent style to customize location puck, accuracy ring, tint, and related location visuals.
the default style of location component
navViewMapStyle
navViewMapStyle is an attribute used to configure the base map's style in the Navigation SDK. It is a string value that corresponds to a Mapbox Style, which can be customized as per the user's needs. This attribute is typically included in a style resource file and can be set to any valid Mapbox style URL or local style file. A string value to configure the base map's style(Mapbox's Style https://docs.mapbox.com/help/glossary/style/)
In the example provided, the attribute is being set within a custom style called "CustomisedNavigationViewLight" which extends the "NavigationViewLight" style.
An example of a Navigation Theme
Example Style
This is an example of a custom theme for the NavigationView in the Navigation SDK. It extends the default NavigationView theme and overrides only the colors/drawables required by your brand.
Route Style
This is an example for customizing route style components like configuring primary/alternative route color, shield color, arrow style, scale, and line cap.
Location Component Style
This is a style resource for the location component in the Maps SDK. It inherits from the base location component style and overrides specific attributes to customize the location layer. The example shows two attributes, nbmap_trackingAnimationDurationMultiplier and nbmap_trackingGesturesManagement. The first attribute sets the duration multiplier for location tracking animation, while the second attribute sets the gestures management for location tracking. This allows developers to fine-tune the behavior of the location layer to match the desired user experience.
For full details of the parent location component style (@style/nbmap_LocationComponent), refer to the Maps style section.
Apply styles to the navigation view
To apply these attributes to the navigation view, first, we need to declare a light style and a dark style(if needed), and then pass them to the SDK
Please note that the parent field will be required if you are not going to override all default attributes. And then pass the styles to the second page via NavLauncherConfig. The NavLauncherConfig.Builder is used to set the route, location layer render mode, light theme, dark theme, and theme mode. The theme mode can be set to "dark", "light", or "system" (default). Finally, the NavigationLauncher.startNavigation() method is called with the activity and the configBuilder.build() as parameters to start the navigation.
Scenario breakdown
Use a different destination icon
A reference of Drawable value. This style definition is used to set the destination marker icon in the navigation view. The attribute "navViewDestinationMarker" accepts a reference to a Drawable. To change the destination marker, one can simply add an item in the style definition with the name "navViewDestinationMarker" and set it to the desired drawable resource.
To use other markers, we can simply add the line below to our style/theme. In the example provided, the destination marker is being set to a drawable resource named "dest_marker". This change will be reflected in the navigation view when the style is applied to the navigation view.
Customize the route style

Colors & Size/Scale
Here is an example for customizing route color palette and route scale values in a single style block.
Upcoming Maneuver arrow
This is an example for customizing the upcoming maneuver arrow’s color/border via route style attributes.
Example
the default values:
Customize the colors of banner instructions
This is an example of how to customize banner instruction colors (background, primary/secondary text, maneuver colors).
The navViewBannerBackground attribute is used to specify the background color of the banner. navViewBannerPrimaryText is used to set the color of the primary text, which is typically the name of the street or road the user is currently on. navViewBannerSecondaryText is used to set the color of the secondary text, which is typically the distance until the next maneuver. navViewBannerManeuverPrimary is used to set the color of the maneuver icon, which is typically an arrow pointing in the direction of the next maneuver.
For example, you can set the background color of the banner to white, the primary text color to black, the secondary text color to gray and the maneuver icon color to blue.
Customize the colors of the bottom summary and instructions list
This example is customizing the colors of the bottom summary and instructions list in the Navigation View.
Change the base map’s style
To configure the base maps’ style is straightforward, simply add the styleable attribute below to our style.
The attribute "navViewMapStyle" is used to customize the style of the base map displayed in the navigation view. The format is a string, which refers to the Mapbox's Style URL (https://docs.mapbox.com/help/glossary/style/).
In the example, your navViewRouteStyle is being set to a string reference of your map style. This allows developers to easily switch between different map styles by changing the value of this attribute in their app's styles.





















