PlaceListNavigationTemplate

Added in 1.0.0
Deprecated in 1.7.0-beta02

@CarProtocol
class PlaceListNavigationTemplate : 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

Public functions

Boolean
equals(other: Any?)
ActionStrip?

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

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

Returns the Header to display in this template.

Action?

This function is deprecated.

use getHeader

ItemList?

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

ActionStrip?

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

OnContentRefreshDelegate?

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

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.

CarText?

This function is deprecated.

use getHeader

Int
Boolean

Returns whether the template is loading.

String

Public functions

equals

fun equals(other: Any?): Boolean

getActionStrip

Added in 1.0.0
Deprecated in 1.7.0-beta02
fun getActionStrip(): ActionStrip?

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)
fun getHeader(): Header?

Returns the Header to display in this template.

See also
setHeader

getHeaderAction

Added in 1.0.0
Deprecated in 1.3.0
fun getHeaderAction(): Action?

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
fun getItemList(): ItemList?

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)
fun getMapActionStrip(): ActionStrip?

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

getOnContentRefreshDelegate

Added in 1.2.0
Deprecated in 1.7.0-beta02
fun getOnContentRefreshDelegate(): OnContentRefreshDelegate?

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)
fun getPanModeDelegate(): 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.

getTitle

Added in 1.0.0
Deprecated in 1.3.0
fun getTitle(): CarText?

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

See also
setTitle

hashCode

fun hashCode(): Int

isLoading

Added in 1.0.0
Deprecated in 1.7.0-beta02
fun isLoading(): Boolean

Returns whether the template is loading.

See also
setLoading

toString

fun toString(): String