SearchTemplate

@CarProtocol
public final class SearchTemplate implements Template


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 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 types

public final class SearchTemplate.Builder

A builder of SearchTemplate.

A listener for search updates.

Public methods

boolean
@Nullable ActionStrip

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

@Nullable Action

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

@Nullable String

Returns the optional initial search text.

@Nullable ItemList

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

@NonNull SearchCallbackDelegate

Returns the SearchCallbackDelegate for search callbacks.

@Nullable String

Returns the optional search hint.

int
boolean

Returns whether the template is loading.

boolean

Returns whether to show the keyboard by default.

@NonNull String

Public methods

equals

Added in 1.4.0-rc02
public boolean equals(@Nullable Object other)

getActionStrip

Added in 1.0.0
public @Nullable ActionStrip getActionStrip()

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

See also
setActionStrip

getHeaderAction

Added in 1.0.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

getInitialSearchText

Added in 1.0.0
public @Nullable String getInitialSearchText()

Returns the optional initial search text.

getItemList

Added in 1.0.0
public @Nullable ItemList getItemList()

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

See also
getItemList

getSearchCallbackDelegate

Added in 1.0.0
public @NonNull SearchCallbackDelegate getSearchCallbackDelegate()

Returns the SearchCallbackDelegate for search callbacks.

getSearchHint

Added in 1.0.0
public @Nullable String getSearchHint()

Returns the optional search hint.

See also
setSearchHint

hashCode

Added in 1.4.0-rc02
public int hashCode()

isLoading

Added in 1.0.0
public boolean isLoading()

Returns whether the template is loading.

See also
setLoading

isShowKeyboardByDefault

Added in 1.0.0
public boolean isShowKeyboardByDefault()

Returns whether to show the keyboard by default.

toString

Added in 1.4.0-rc02
public @NonNull String toString()