The second Android 11 Developer Preview is now available, test it out and share your feedback.

DisplayFeature

public final class DisplayFeature
extends Object

java.lang.Object
   ↳ androidx.window.DisplayFeature


Description of a physical feature on the display.

A display feature is a distinctive physical attribute located within the display panel of the device. It can intrude into the application window space and create a visual distortion, visual or touch discontinuity, make some area invisible or create a logical divider or separation in the screen space.

Summary

Nested classes

class DisplayFeature.Builder

Builder for DisplayFeature objects. 

Constants

int TYPE_FOLD

A fold in the flexible screen without a physical gap.

int TYPE_HINGE

A physical separation with a hinge that allows two display panels to fold.

Public methods

Rect getBounds()

Get bounding rectangle of the physical display feature in the coordinate space of the window.

int getType()

Get type of the physical display feature.

String toString()

Inherited methods

Constants

TYPE_FOLD

public static final int TYPE_FOLD

A fold in the flexible screen without a physical gap.

Constant Value: 1 (0x00000001)

TYPE_HINGE

public static final int TYPE_HINGE

A physical separation with a hinge that allows two display panels to fold.

Constant Value: 2 (0x00000002)

Public methods

getBounds

public Rect getBounds ()

Get bounding rectangle of the physical display feature in the coordinate space of the window. The rectangle provides information about the location of the feature in the window and its size.

Returns
Rect

getType

public int getType ()

Get type of the physical display feature.

Returns
int

toString

public String toString ()

Returns
String