DeviceState
public
final
class
DeviceState
extends Object
java.lang.Object | |
↳ | androidx.window.DeviceState |
This class is deprecated.
Use FoldingFeature
to get the state of the hinge instead. Will be removed in
alpha03.
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 |
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 | |
---|---|
boolean
|
equals(Object o)
|
int
|
getPosture()
Gets the posture of a foldable device with a flexible screen or multiple physical screens. |
int
|
hashCode()
|
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. See the Posture section in the official documentation for visual samples and references.
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. See the Posture section in the official documentation for visual samples and references.
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. See the Posture section in the official documentation for visual samples and references.
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. See the Posture section in the official documentation for visual samples and references.
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
equals
public boolean equals (Object o)
Parameters | |
---|---|
o |
Object |
Returns | |
---|---|
boolean |
getPosture
public int getPosture ()
Gets 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 |
hashCode
public int hashCode ()
Returns | |
---|---|
int |
toString
public String toString ()
Returns | |
---|---|
String |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-02-02 UTC.