Android 12 Developer Preview is here! Try it out, and give us your feedback!

DisplayFeature

interface DisplayFeature
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
open

Constants
static Int

static Int

Public methods
abstract Rect

The bounding rectangle of the feature within the application window in the window coordinate space.

abstract Int

Constants

TYPE_FOLD

static val TYPE_FOLD: Int

Deprecated: Will be removed in the next alpha. See FoldingFeature.

Value: 1

TYPE_HINGE

static val TYPE_HINGE: Int

Deprecated: Will be removed in the next alpha. See FoldingFeature

Value: 2

Public methods

getBounds

@NonNull abstract fun getBounds(): Rect

The bounding rectangle of the feature within the application window in the window coordinate space.

Return
Rect bounds of display feature.

getType

abstract fun getType(): Int

Deprecated: Will be removed in the next alpha. Cast to a FoldingFeature.

Return
Int TYPE_FOLD or TYPE_HINGE depending on the feature returned.