AndroidDisplay
| Kind | class |
| Package | android.platform |
| Full name | android.platform.AndroidDisplay |
| Source | source/android/platform/AndroidDisplay.hx |
Native display information: physical resolution, density/DPI, orientation, refresh rate and display cutout insets, plus immersive (edge-to-edge) fullscreen handling.
Public fields
| Name | Type | Static | Default | Notes |
|---|---|---|---|---|
ROTATION_0 | Int | yes | 0 | final · android.view.Surface rotation constants. |
ROTATION_90 | Int | yes | 1 | final |
ROTATION_180 | Int | yes | 2 | final |
ROTATION_270 | Int | yes | 3 | final |
onChanged | FlxSignal | yes | — | property (get, never) · Fired when the display configuration changes (rotation, mode, ...). |
Public methods
getInfo
static function getInfo():Null<DisplayInfo>
Queries the display for full information. On non-Android targets returns null; callers should fall back to FlxG.stage dimensions.
getCutoutInsets
static function getCutoutInsets():CutoutInsets
Cutout safe insets as {left, top, right, bottom} pixels (all 0 when none).
getRefreshRate
static function getRefreshRate():Float
Active display refresh rate (falls back to 60 when unknown).
setImmersive
static function setImmersive(mode:String = "full"):Void
Applies an immersive mode: "full" - hide status + navigation bars, re-show transiently on swipe "lean" - hide bars, any swipe re-shows them "off" - restore all system bars
| Parameter | Type | Default |
|---|---|---|
mode (optional) | String | "full" |
setCutoutMode
static function setCutoutMode(mode:String = "shortEdges"):Void
Display cutout behavior: "default", "shortEdges", "always" or "never". Controls how content lays out around notches and hole-punch cameras.
| Parameter | Type | Default |
|---|---|---|
mode (optional) | String | "shortEdges" |
setPreferredRefreshRate
static function setPreferredRefreshRate(rate:Float):Void
Best-effort request for a preferred refresh rate (API 23+). Pass 0 to clear the preference.
| Parameter | Type | Default |
|---|---|---|
rate | Float | — |
watchDisplay
static function watchDisplay():Void
Starts receiving display change events (onChanged).
Internals
Private / internal members
| Field | Type | Static |
|---|---|---|
_getDisplayInfo | Dynamic | yes |
_getCutoutInsets | Dynamic | yes |
_setImmersive | Dynamic | yes |
_setCutoutMode | Dynamic | yes |
_setPreferredRefreshRate | Dynamic | yes |
_registerDisplayListener | Dynamic | yes |
| Method |
|---|
static inline function get_onChanged():FlxSignal |
static function getDisplayInfo_jni():String |
static function getCutoutInsets_jni():String |
static function setImmersive_jni(mode:String):Void |
static function setCutoutMode_jni(mode:String):Void |
static function setPreferredRefreshRate_jni(rate:Float):Void |
static function registerDisplayListener_jni():Void |