Google is committed to advancing racial equity for Black communities. See how.

RoutePreviewNavigationTemplate

public final class RoutePreviewNavigationTemplate
extends Object implements Template

java.lang.Object
   ↳ com.google.android.libraries.car.app.navigation.model.RoutePreviewNavigationTemplate


A template that supports showing a list of routes alongside a custom drawn map.

The list must have its ItemList.OnSelectedListener set, and the template must have its navigate action set (see RoutePreviewNavigationTemplate.Builder.setNavigateAction(Action)). These are used in conjunction to inform the app that:

  1. A route has been selected. The app should also highlight the route on the map surface.
  2. A navigate action has been triggered. The app should begin navigation using the selected route.

The template itself does not expose a drawing surface. In order to draw on the canvas, use AppManager.setSurfaceListener(SurfaceListener).

Template Restrictions

In regards to template refreshes, as described in Screen.getTemplate(), this template is considered a refresh of a previous one if:

In order to use this template your car app MUST declare that it uses the com.google.android.libraries.car.app.NAVIGATION_TEMPLATES permission in the manifest.

Summary

Nested classes

class RoutePreviewNavigationTemplate.Builder

A builder of RoutePreviewNavigationTemplate

Public methods

static RoutePreviewNavigationTemplate.Builder builder()

Constructs a new builder of RoutePreviewNavigationTemplate.

boolean equals(Object other)
int hashCode()
String toString()

Inherited methods

Public methods

builder

public static RoutePreviewNavigationTemplate.Builder builder ()

Constructs a new builder of RoutePreviewNavigationTemplate.

Returns
RoutePreviewNavigationTemplate.Builder

equals

public boolean equals (Object other)

Parameters
other Object

Returns
boolean

hashCode

public int hashCode ()

Returns
int

toString

public String toString ()

Returns
String