SearchTemplate

public final class SearchTemplate
extends Object implements Template

java.lang.Object
   ↳ androidx.car.app.model.SearchTemplate


A model that allows the user to enter text searches, and can display results in a list.

Template Restrictions

In regards to template refreshes, as described in Screen.onGetTemplate(), this template supports any content changes as refreshes. This allows apps to interactively update the search results as the user types without the templates being counted against the quota.

Summary

Nested classes

class SearchTemplate.Builder

A builder of SearchTemplate

interface SearchTemplate.SearchCallback

A listener for search updates. 

Public methods

boolean equals(Object other)
ActionStrip getActionStrip()

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

Action getHeaderAction()

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

String getInitialSearchText()

Returns the optional initial search text.

ItemList getItemList()

Returns the ItemList for search results or null if not set.

SearchCallbackDelegate getSearchCallbackDelegate()

Returns the SearchCallbackDelegate for search callbacks.

String getSearchHint()

Returns the optional search hint.

int hashCode()
boolean isLoading()

Returns whether the template is loading.

boolean isShowKeyboardByDefault()

Returns whether to show the keyboard by default.

String toString()

Inherited methods

Public methods

equals

public boolean equals (Object other)

Parameters
other Object

Returns
boolean

getActionStrip

public ActionStrip getActionStrip ()

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

Returns
ActionStrip

getHeaderAction

public Action getHeaderAction ()

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

Returns
Action

getInitialSearchText

public String getInitialSearchText ()

Returns the optional initial search text.

Returns
String

getItemList

public ItemList getItemList ()

Returns the ItemList for search results or null if not set.

Returns
ItemList

See also:

getSearchCallbackDelegate

public SearchCallbackDelegate getSearchCallbackDelegate ()

Returns the SearchCallbackDelegate for search callbacks.

Returns
SearchCallbackDelegate

getSearchHint

public String getSearchHint ()

Returns the optional search hint.

Returns
String

hashCode

public int hashCode ()

Returns
int

isLoading

public boolean isLoading ()

Returns whether the template is loading.

Returns
boolean

See also: