TabTemplate


@CarProtocol
@RequiresCarApi(value = 6)
public class TabTemplate implements Template


A template representing a list of tabs and contents for the active tab.

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 Tabs structure between the templates has not changed and if the new template has the same active tab then the contents of that tab hasn't changed. This means that if the previous template has multiple Tabs, the new template must have the same number of tabs with the same title and icon.

Summary

Nested types

public final class TabTemplate.Builder

A builder of TabTemplate.

public interface TabTemplate.TabCallback

A listener for tab selection.

Public methods

boolean
@NonNull String

Returns the getContentId for the active tab.

@NonNull Action

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

@NonNull TabCallbackDelegate

Returns the TabCallbackDelegate for tab related callbacks.

@NonNull TabContents

Returns the TabContents for the currently active tab.

@NonNull List<Tab>

Returns the list of Tabs in the template.

int
boolean

Returns whether the template is loading.

@NonNull String

Public methods

equals

public boolean equals(@Nullable Object other)

getActiveTabContentId

Added in 1.4.0
public @NonNull String getActiveTabContentId()

Returns the getContentId for the active tab.

getHeaderAction

Added in 1.3.0
public @NonNull 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

getTabCallbackDelegate

Added in 1.3.0
public @NonNull TabCallbackDelegate getTabCallbackDelegate()

Returns the TabCallbackDelegate for tab related callbacks.

getTabContents

Added in 1.3.0
public @NonNull TabContents getTabContents()

Returns the TabContents for the currently active tab.

getTabs

Added in 1.3.0
public @NonNull List<TabgetTabs()

Returns the list of Tabs in the template.

hashCode

public int hashCode()

isLoading

Added in 1.3.0
public boolean isLoading()

Returns whether the template is loading.

See also
setLoading

toString

public @NonNull String toString()