Screen

public class Screen<T extends Screen<T>> implements ScreenActions

Container class for UI elements.

This class groups UI elements and grants access to basic actions, such as tapBack() and closeSoftKeyboard()

Parameters

T

type of your screen, done to enable invoke() for its children

See also

Constructors

Link copied to clipboard
public Screen<T> Screen()

Types

Link copied to clipboard
public class Companion

Properties

Link copied to clipboard
public final static Screen.Companion Companion
Link copied to clipboard
private KBaseView<?> rootView

The visibility of rootView will be checked when entering the screen

Link copied to clipboard

ViewInteractionDelegate on which all actions are performed (root view by default)

Functions

Link copied to clipboard

Closes soft keyboard, if opened

Link copied to clipboard
public KBaseView<?> getRootView()

The visibility of rootView will be checked when entering the screen

Link copied to clipboard

ViewInteractionDelegate on which all actions are performed (root view by default)

Link copied to clipboard
public final Unit intercept(Function1<Interceptor.Configurator, Unit> configurator)

Sets the interceptors for the screen. Interceptors will be invoked on all interactions while the screen is active.

Link copied to clipboard
public final Unit invoke(Function1<T, Unit> function)

Operator that allows usage of DSL style

Link copied to clipboard
public Unit pressBack()

Performs click on device's back button

Link copied to clipboard
public Unit pressKey(EspressoKey key)

Presses a key with correspondingKeyCode and modifiers

public Unit pressKey(Integer keyCode)

Presses a key with corresponding KeyCode

Link copied to clipboard
public Unit pressMenuKey()

Presses the hardware menu key

Link copied to clipboard
public final Unit reset()

Removes the interceptors from the screen.

Link copied to clipboard
public Unit setRootView(KBaseView<?> rootView)

The visibility of rootView will be checked when entering the screen