Packagecom.distriqt.extension.application.display
Interfacepublic interface Display extends flash.events.IEventDispatcher



Public Properties
 PropertyDefined By
  displayMetrics : DisplayMetrics
[read-only] This allows you to get information about the display on the current device.
Display
  userInterfaceStyle : String
[read-only] Returns the current user interface style for the application.
Display
  willCutoutAffectView : Boolean
[read-only] This function will determine if the current application view will be affected by a screen cutout or notch.
Display
Public Methods
 MethodDefined By
  
getBrightness():Number
Gets the screen brightness.
Display
  
Returns the display cutout if there is one The display cutout represents the area of the display that is not functional for displaying content, i.e.
Display
  
Returns the height of the status bar in pixels.
Display
  
Android Only Returns the last setSystemUiVisibility(int) that this view has requested.
Display
  
setBrightness(value:Number, animated:Boolean = false):Boolean
Sets the screen brightness.
Display
  
setDisplayMode(displayMode:String, layoutMode:String):Boolean
Sets the display mode for the application Support: Android;
Display
  
setNavigationBarColour(colour:uint):Boolean
Set the colour of the Android Navigation bar for API versions >= 21 (Lollipop)
Display
  
setNavigationBarStyle(style:int):Boolean
Sets the style of the navigation bar icons on Android
Display
  
setStatusBarColour(colour:uint, alpha:Number = 1):Boolean
Set the colour of the Android Status bar for API versions >= 21 (Lollipop)
Display
  
setStatusBarHidden(hidden:Boolean = true, animation:String = none):Boolean
Hides/Shows the status bar on iOS Support: iOS only
Display
  
setStatusBarStyle(style:uint, animated:Boolean = false):Boolean
Sets the UIStatusBarStyle for the status bar on iOS and controls the icon styles on Android
Display
  
setSystemUiVisibility(flags:int):Boolean
Android Only Allows direct access to set the System UI Visibility flag on Android.
Display
Property Detail
displayMetricsproperty
displayMetrics:DisplayMetrics  [read-only]

This allows you to get information about the display on the current device.


Implementation
    public function get displayMetrics():DisplayMetrics
userInterfaceStyleproperty 
userInterfaceStyle:String  [read-only]

Returns the current user interface style for the application. This defines whether the system has a "dark mode" in place for the application or the default "light". This will be one of the values defined in UserInterfaceStyle


Implementation
    public function get userInterfaceStyle():String
willCutoutAffectViewproperty 
willCutoutAffectView:Boolean  [read-only]

This function will determine if the current application view will be affected by a screen cutout or notch. This will not definitely determine if the device has a notch but if your application view will be affected by one. Eg in the case when your application is displayed below the notch then and hence unaffected by the cutout it will return false. If this returns true then the getSafeArea function will return the area unaffected by the cutouts.


Implementation
    public function get willCutoutAffectView():Boolean
Method Detail
getBrightness()method
public function getBrightness():Number

Gets the screen brightness.

Returns
Number — The brightness value, in the range 0 - 1. This may return -1 if there was an error retrieving the brightness
getDisplayCutout()method 
public function getDisplayCutout():DisplayCutout

Returns the display cutout if there is one The display cutout represents the area of the display that is not functional for displaying content, i.e. is occupied by hardware components such as a display notch for cameras

Returns
DisplayCutoutDisplayCutout object for the current display or null if there isn't one.
getStatusBarHeight()method 
public function getStatusBarHeight():int

Returns the height of the status bar in pixels. The status bar is the top area of the UI where items such as the battery level, connection strength, and notifications etc are displayed.

Returns
int — The height of the status bar in pixels
getSystemUiVisibility()method 
public function getSystemUiVisibility():int

Android Only Returns the last setSystemUiVisibility(int) that this view has requested.

Returns
int — The System UI Visibility flag

See also

setBrightness()method 
public function setBrightness(value:Number, animated:Boolean = false):Boolean

Sets the screen brightness. The system may reset this value in certain circumstances, eg after opening from a device lock. These circumstances depend on the operating system and the version. We suggest you use the application state events to set your desired value each time the application is brought to the foreground.

Parameters

value:Number — The brightness value, in the range 0 - 1
 
animated:Boolean (default = false) — (not supported currently)

Returns
Booleantrue if successful and false if changing the brightness isn't supported
setDisplayMode()method 
public function setDisplayMode(displayMode:String, layoutMode:String):Boolean

Sets the display mode for the application Support:

Parameters

displayMode:String — The display mode to set
 
layoutMode:String (default = NaN) — The layout mode to set, determining how to handle cutouts

Returns
Booleantrue if the mode was set correctly and false if there was an error or the functionality is not supported

See also

setNavigationBarColour()method 
public function setNavigationBarColour(colour:uint):Boolean

Set the colour of the Android Navigation bar for API versions >= 21 (Lollipop)

Parameters

colour:uint — The colour to use for the background of the status bar

Returns
Booleantrue if the colour was set, or false if the device doesn't support navigation bar colour or if an error occurred.
setNavigationBarStyle()method 
public function setNavigationBarStyle(style:int):Boolean

Sets the style of the navigation bar icons on Android

Parameters

style:int — The status bar style to be set

Returns
Boolean

See also

setStatusBarColour()method 
public function setStatusBarColour(colour:uint, alpha:Number = 1):Boolean

Set the colour of the Android Status bar for API versions >= 21 (Lollipop)

Parameters

colour:uint — The colour to use for the background of the status bar
 
alpha:Number (default = 1)

Returns
Booleantrue if the colour was set, or false if the device doesn't support status bar colour or if an error occurred.
setStatusBarHidden()method 
public function setStatusBarHidden(hidden:Boolean = true, animation:String = none):Boolean

Hides/Shows the status bar on iOS

Support: iOS only

Parameters

hidden:Boolean (default = true) — Whether the status bar is hidden or shown (true to hide)
 
animation:String (default = none) — The animation to use (either "fade", "slide" or "none" )

Returns
Boolean
setStatusBarStyle()method 
public function setStatusBarStyle(style:uint, animated:Boolean = false):Boolean

Sets the UIStatusBarStyle for the status bar on iOS and controls the icon styles on Android

Parameters

style:uint — The status bar style to be set
 
animated:Boolean (default = false) — Whether to animate the style transition

Returns
Boolean

See also

StatusBarStyle.DEFAULT
StatusBarStyle.DARK
StatusBarStyle.LIGHT
setSystemUiVisibility()method 
public function setSystemUiVisibility(flags:int):Boolean

Android Only Allows direct access to set the System UI Visibility flag on Android. Please see the Android documentation on usage of the flags.

Parameters

flags:int — Bit values from the Android flags

Returns
Booleantrue if supported and the view was updated

See also