Google is committed to advancing racial equity for Black communities. See how.

ScreenController

public class ScreenController
extends Object

java.lang.Object
   ↳ com.google.android.libraries.car.app.testing.ScreenController


A controller that allows testing of a Screen.

This controller will allows:

Summary

Public methods

ScreenController create()

Creates the Screen being controlled.

ScreenController destroy()

Destroys to the Screen being controlled.

Screen get()

Retrieves the Screen being controlled.

List<Template> getTemplatesReturned()

Retrieves all the Templates returned from Screen.getTemplate() for the Screen being controlled.

static ScreenController of(TestCarContext testCarContext, Screen screen)

Creates a ScreenController to control a Screen for testing.

ScreenController pause()

Pauses the Screen being controlled.

void reset()

Resets values tracked by this ScreenController.

ScreenController resume()

Resumes the Screen being controlled.

ScreenController start()

Starts the Screen being controlled.

ScreenController stop()

Stops to the Screen being controlled.

Inherited methods

Public methods

create

public ScreenController create ()

Creates the Screen being controlled.

This method will also push the Screen onto the ScreenManager's screen stack if it isn't the current top.

Returns
ScreenController

destroy

public ScreenController destroy ()

Destroys to the Screen being controlled.

Returns
ScreenController

get

public Screen get ()

Retrieves the Screen being controlled.

Returns
Screen

getTemplatesReturned

public List<Template> getTemplatesReturned ()

Retrieves all the Templates returned from Screen.getTemplate() for the Screen being controlled.

The templates are stored in order of calls.

The templates will be stored until reset() is called.

Returns
List<Template>

of

public static ScreenController of (TestCarContext testCarContext, 
                Screen screen)

Creates a ScreenController to control a Screen for testing.

Parameters
testCarContext TestCarContext

screen Screen

Returns
ScreenController

pause

public ScreenController pause ()

Pauses the Screen being controlled.

Returns
ScreenController

reset

public void reset ()

Resets values tracked by this ScreenController.

resume

public ScreenController resume ()

Resumes the Screen being controlled.

This method will also push the Screen onto the ScreenManager's screen stack if it isn't the current top.

Returns
ScreenController

start

public ScreenController start ()

Starts the Screen being controlled.

This method will also push the Screen onto the ScreenManager's screen stack if it isn't the current top.

Returns
ScreenController

stop

public ScreenController stop ()

Stops to the Screen being controlled.

Returns
ScreenController