androidx.test.espresso.device.action


Interfaces

DeviceAction

Responsible for performing an interaction on the given device.

Enums

ScreenOrientation

Enum for screen orientations a device can be set to.

Top-level functions summary

DeviceAction

Set device screen to be folded with the hinge in the vertical position.

DeviceAction

Set device screen to be closed.

DeviceAction
setDisplaySize(
    widthSizeClass: WidthSizeClass,
    heightSizeClass: HeightSizeClass
)

Set device's window size.

DeviceAction

Set device screen to be completely flat, like a tablet.

DeviceAction

Set device's screen orientation.

DeviceAction

Set device screen to be folded with the hinge in the horizontal position.

Top-level functions

fun setBookMode(): DeviceAction

Set device screen to be folded with the hinge in the vertical position. For details on foldable postures, see https://developer.android.com/guide/topics/large-screens/learn-about-foldables#foldable_postures

This action is for foldable devices only. Currently only supported for tests run on Android Emulators.

fun setClosedMode(): DeviceAction

Set device screen to be closed.

This action is for foldable devices only. Currently only supported for tests run on Android Emulators.

fun setDisplaySize(
    widthSizeClass: WidthSizeClass,
    heightSizeClass: HeightSizeClass
): DeviceAction

Set device's window size.

Parameters
widthSizeClass: WidthSizeClass

the window width to set the device to

heightSizeClass: HeightSizeClass

the window height to set the device to

fun setFlatMode(): DeviceAction

Set device screen to be completely flat, like a tablet. For details on foldable postures, see https://developer.android.com/guide/topics/large-screens/learn-about-foldables#foldable_postures

This action is for foldable devices only. Currently only supported for tests run on Android Emulators.

setScreenOrientation

fun setScreenOrientation(orientation: ScreenOrientation): DeviceAction

Set device's screen orientation.

Parameters
orientation: ScreenOrientation

the orientation to set the device to (portait or landscape)

fun setTabletopMode(): DeviceAction

Set device screen to be folded with the hinge in the horizontal position. For details on foldable postures, see https://developer.android.com/guide/topics/large-screens/learn-about-foldables#foldable_postures

This action is for foldable devices only. Currently only supported for tests run on Android Emulators.