ListTemplateController
public
class
ListTemplateController
extends Object
java.lang.Object | |
↳ | com.google.android.libraries.car.app.testing.model.ListTemplateController |
A controller that allows testing of a ListTemplate
.
This controller allows:
- Retrieving the title which is set via
ListTemplate.Builder.setTitle(CharSequence)
. - Retrieving
ItemList
s added viaListTemplate.Builder.setSingleList(ItemList)
orListTemplate.Builder.addList(ItemList, CharSequence)
. - Retrieving the loading state set via
ListTemplate.Builder.setIsLoading(boolean)
. - Retrieving the header
Action
which is set viaListTemplate.Builder.setHeaderAction(Action)
. - Retrieving the
ActionStrip
set viaListTemplate.Builder.setActionStrip(ActionStrip)
. - Retrieving
Row
s contained in theItemList
s in theListTemplate
.
Summary
Public methods | |
---|---|
ListTemplate
|
get()
Retrieves the |
ActionStripController
|
getActionStrip()
Retrieves a |
List<ItemListController>
|
getAllItemLists()
Returns a list of |
ActionController
|
getHeaderAction()
Retrieves a |
ItemListController
|
getItemListByHeader(String header)
Returns an |
RowController
|
getRowByTitle(String title)
Returns a |
ItemListController
|
getSingleList()
Returns an |
String
|
getTitle()
Retrieves the title of the |
boolean
|
isLoading()
Returns |
static
ListTemplateController
|
of(ListTemplate listTemplate)
Creates a |
Inherited methods | |
---|---|
Public methods
get
public ListTemplate get ()
Retrieves the ListTemplate
that this controller is controlling.
Returns | |
---|---|
ListTemplate |
getActionStrip
public ActionStripController getActionStrip ()
Retrieves a ActionStripController
for the ActionStrip
that is present in the
ListTemplate
that is being controlled, or null
if none is present.
Returns | |
---|---|
ActionStripController |
getAllItemLists
public List<ItemListController> getAllItemLists ()
Returns a list of ItemListController
s containing all ItemList
s included in the
ListTemplate
that is being controlled.
Returns | |
---|---|
List<ItemListController> |
getHeaderAction
public ActionController getHeaderAction ()
Retrieves a ActionController
for the header Action
that is being controlled, or
null
if none is present.
Returns | |
---|---|
ActionController |
getItemListByHeader
public ItemListController getItemListByHeader (String header)
Returns an ItemListController
for the first ItemList
that was added with the
given header as its header, or null
if none match.
The value should be the CharSequence.toString()
for the header originally provided.
Parameters | |
---|---|
header |
String |
Returns | |
---|---|
ItemListController |
getRowByTitle
public RowController getRowByTitle (String title)
Returns a RowController
containing the first Row
that was added with the given
header as its header, in an ItemList
contained in the ListTemplate
that is
being controlled, or null
if none match.
The value should be the CharSequence.toString()
for the title originally provided.
Parameters | |
---|---|
title |
String |
Returns | |
---|---|
RowController |
getSingleList
public ItemListController getSingleList ()
Returns an ItemListController
containing the ItemList
set via ListTemplate.Builder.setSingleList(ItemList)
, or null
if is is not present.
Returns | |
---|---|
ItemListController |
getTitle
public String getTitle ()
Retrieves the title of the ListTemplate
that is being controlled, or null
if it
does not have one.
The value returned is the CharSequence.toString()
for the title provided.
Returns | |
---|---|
String |
isLoading
public boolean isLoading ()
Returns true
if the template is set to be loading.
This state is set via calling ListTemplate.Builder.setIsLoading(boolean)
.
Returns | |
---|---|
boolean |
of
public static ListTemplateController of (ListTemplate listTemplate)
Creates a ListTemplateController
to control an ListTemplate
for testing.
Parameters | |
---|---|
listTemplate |
ListTemplate |
Returns | |
---|---|
ListTemplateController |