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 inScreen.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 |
interface |
SearchTemplate.SearchCallback
A listener for search updates. |
Public methods | |
---|---|
boolean
|
equals(Object other)
|
ActionStrip
|
getActionStrip()
Returns the |
Action
|
getHeaderAction()
Returns the |
String
|
getInitialSearchText()
Returns the optional initial search text. |
ItemList
|
getItemList()
Returns the |
SearchCallbackDelegate
|
getSearchCallbackDelegate()
Returns the |
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 |
isShowKeyboardByDefault
public boolean isShowKeyboardByDefault ()
Returns whether to show the keyboard by default.
Returns | |
---|---|
boolean |
toString
public String toString ()
Returns | |
---|---|
String |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-03-24 UTC.