NavigationTemplate
public
class
NavigationTemplate
extends Object
implements
Template
java.lang.Object | |
↳ | com.google.android.libraries.car.app.navigation.model.NavigationTemplate |
A template for showing navigation information.
This template has two independent sections which can be updated:
- Navigation information such as routing instructions or navigation-related messages.
- Travel estimates to the destination.
To update the template as the user navigates, call Screen.invalidate()
to provide the
host with a new template with the updated information.
The template itself does not expose a drawing surface. In order to draw on the canvas, use
AppManager.setSurfaceListener(SurfaceListener)
.
See CarAppExtender
for how to show
alerts with notifications. Frequent alert notifications distract the driver and are discouraged.
Template Restrictions
In regard to template refreshes, as described inScreen.getTemplate()
, this template
supports any content changes as refreshes. This allows apps to interactively update the
turn-by-turn instructions without the templates being counted against the template quota.
Further, this template is considered a view that the user will stay and consume contents from, and the host will reset the template quota once an app reaches this template.
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 |
NavigationTemplate.Builder
A builder of |
interface |
NavigationTemplate.NavigationInfo
Represents navigation information such as routing instructions or navigation-related messages. |
Public methods | |
---|---|
static
NavigationTemplate.Builder
|
builder()
Constructs a new builder of |
void
|
checkPermissions(Context context)
|
boolean
|
equals(Object other)
|
int
|
hashCode()
|
String
|
toString()
|
Inherited methods | |
---|---|
Public methods
builder
public static NavigationTemplate.Builder builder ()
Constructs a new builder of NavigationTemplate
.
Returns | |
---|---|
NavigationTemplate.Builder |
hashCode
public int hashCode ()
Returns | |
---|---|
int |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-15 UTC.