PlaceListNavigationTemplate

Added in 1.0.0
Deprecated in 1.7.0-beta02

@CarProtocol
public final class PlaceListNavigationTemplate implements Template


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

The template itself does not expose a drawing surface. In order to draw on the canvas, use setSurfaceCallback.

Template Restrictions In regards to template refreshes, as described in onGetTemplate, this template is considered a refresh of a previous one if:
  • The previous template is in a loading state (see setLoading, or
  • The template title has not changed, and the number of rows and the title (not counting spans) of each row between the previous and new ItemLists have not changed.
  • The template is sent in response to a user-initiated content refresh request. (see setOnContentRefreshListener.

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

For instance, using the deprecated PlaceListNavigationTemplate, if the template was:
PlaceListNavigationTemplate template = new PlaceListNavigationTemplate.Builder()
         .setItemList(itemListBuilder.build())
         .setHeader(header)
         .setActionStrip(actionStrip)
         .setMapActionStrip(mapActionStrip)
         .build();
Using the new MapWithContentTemplate, the template would be:
MapWithContentTemplate template = new MapWithContentTemplate.Builder()
           .setContentTemplate(new ListTemplate.Builder()
                  .setSingleList(itemListBuilder.build())
                  .setHeader(header)
                  .build())
           .setActionStrip(actionStrip)
           .setMapController(new MapController.Builder()
                 .setMapActionStrip(mapActionStrip)
                 .build())
           .build();

Summary

Nested types

A builder of PlaceListNavigationTemplate.

Public methods

boolean
@Nullable ActionStrip

Returns the ActionStrip for this template or null if not set.

@Nullable Header
@RequiresCarApi(value = 5)
getHeader()

Returns the Header to display in this template.

@Nullable Action

This method is deprecated.

use getHeader

@Nullable ItemList

Returns the list of items to display alongside the map or null if the list is not set.

@Nullable ActionStrip

Returns the map ActionStrip for this template or null if not set.

@Nullable OnContentRefreshDelegate

Returns the OnContentRefreshDelegate to be called when the user requests for content refresh for this template.

@Nullable PanModeDelegate

Returns the PanModeDelegate that should be called when the user interacts with pan mode on this template, or null if a PanModeListener was not set.

@Nullable CarText

This method is deprecated.

use getHeader

int
boolean

Returns whether the template is loading.

@NonNull String

Public methods

equals

public boolean equals(@Nullable Object other)

getActionStrip

Added in 1.0.0
Deprecated in 1.7.0-beta02
public @Nullable ActionStrip getActionStrip()

Returns the ActionStrip for this template or null if not set.

See also
setActionStrip

getHeader

Added in 1.3.0
Deprecated in 1.7.0-beta02
@RequiresCarApi(value = 5)
public @Nullable Header getHeader()

Returns the Header to display in this template.

See also
setHeader

getHeaderAction

Added in 1.0.0
Deprecated in 1.3.0
public @Nullable Action getHeaderAction()

Returns the Action that is set to be displayed in the header of the template or null if not set.

See also
setHeaderAction

getItemList

Added in 1.0.0
Deprecated in 1.7.0-beta02
public @Nullable ItemList getItemList()

Returns the list of items to display alongside the map or null if the list is not set.

See also
setItemList

getMapActionStrip

Added in 1.1.0
Deprecated in 1.7.0-beta02
@RequiresCarApi(value = 4)
public @Nullable ActionStrip getMapActionStrip()

Returns the map ActionStrip for this template or null if not set.

getOnContentRefreshDelegate

Added in 1.2.0
Deprecated in 1.7.0-beta02
public @Nullable OnContentRefreshDelegate getOnContentRefreshDelegate()

Returns the OnContentRefreshDelegate to be called when the user requests for content refresh for this template.

getPanModeDelegate

Added in 1.1.0
Deprecated in 1.7.0-beta02
@RequiresCarApi(value = 4)
public @Nullable PanModeDelegate getPanModeDelegate()

Returns the PanModeDelegate that should be called when the user interacts with pan mode on this template, or null if a PanModeListener was not set.

getTitle

Added in 1.0.0
Deprecated in 1.3.0
public @Nullable CarText getTitle()

Returns the title of the template or null if not set.

See also
setTitle

hashCode

public int hashCode()

isLoading

Added in 1.0.0
Deprecated in 1.7.0-beta02
public boolean isLoading()

Returns whether the template is loading.

See also
setLoading

toString

public @NonNull String toString()