Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る

DeviceState

public final class DeviceState
extends Object

java.lang.Object
   ↳ androidx.window.DeviceState


Information about the state of the device.

Currently only includes the description of the state for foldable devices.

Summary

Nested classes

class DeviceState.Builder

Builder for DeviceState objects. 

Constants

int POSTURE_CLOSED

The foldable device is closed, its primary screen area is not accessible.

int POSTURE_FLIPPED

The foldable device is flipped with the flexible screen parts or physical screens facing opposite directions.

int POSTURE_HALF_OPENED

The foldable device's hinge is in an intermediate position between opened and closed state, there is a non-flat angle between parts of the flexible screen or between physical screen panels.

int POSTURE_OPENED

The foldable device is completely open, the screen space that is presented to the user is flat.

int POSTURE_UNKNOWN

Unknown state of the device.

Public methods

int getPosture()

Get the posture of a foldable device with a flexible screen or multiple physical screens.

String toString()

Inherited methods

Constants

POSTURE_CLOSED

public static final int POSTURE_CLOSED

The foldable device is closed, its primary screen area is not accessible.

Constant Value: 1 (0x00000001)

POSTURE_FLIPPED

public static final int POSTURE_FLIPPED

The foldable device is flipped with the flexible screen parts or physical screens facing opposite directions. ________________ *________________

Constant Value: 4 (0x00000004)

POSTURE_HALF_OPENED

public static final int POSTURE_HALF_OPENED

The foldable device's hinge is in an intermediate position between opened and closed state, there is a non-flat angle between parts of the flexible screen or between physical screen panels. | | | | | *________________

Constant Value: 2 (0x00000002)

POSTURE_OPENED

public static final int POSTURE_OPENED

The foldable device is completely open, the screen space that is presented to the user is flat. ________________ ________________ *

Constant Value: 3 (0x00000003)

POSTURE_UNKNOWN

public static final int POSTURE_UNKNOWN

Unknown state of the device. May mean that either this device doesn't support different postures or doesn't provide any information about its state at all.

Constant Value: 0 (0x00000000)

Public methods

getPosture

public int getPosture ()

Get the posture of a foldable device with a flexible screen or multiple physical screens. Devices with a single rigid display will always report POSTURE_UNKNOWN.

Returns
int

toString

public String toString ()

Returns
String