display by Trigger.io

Currently displaying version

display: App display options

The forge.display namespace allows you to control how your app will be displayed as the device is moved around.

The default is to allow for any orientation, with the content being re-drawn as the screen is rotated.

Config options

Statusbar

Android

Hidden
Sets Android status bar visibility on supported devices.
Transparent
Sets Android status bar transparency on supported devices.
Background Color
Enter an RGB color string, e.g. "#FFFF00" to set the color of the status bar. (Android 5.0+ only)

iOS

Hidden
Sets iOS status bar visibility.
Transparent
Sets iOS status bar transparency.
Style
Sets the status bar style on iOS, default will use black text, light_content will use white text.

Orientations

iPhone, iPad, Android
Set the default orientation lock on a per platform basis. These options can be set to any of "any", "portrait" or "landscape" to limit the orientations usable by the app.

API

The display module also allows you to change the orientation limitations while your app is running with the following API.

forge.display.setStatusBarHidden(hidden, success, error)

iOS, Android

Sets status bar visibility on supported devices.

Parameters:
hidden
bool The status bar is hidden when set to true and visible when set to false.
success
function(value) callback to be invoked when no errors occur
error
function(content) called with details of any error which may occur

forge.display.setStatusBarTransparent(transparent, success, error)

iOS, Android

Sets status bar transparency on supported devices.

Parameters:
transparent
bool The status bar is transparent when set to true and opaque when set to false.
success
function(value) callback to be invoked when no errors occur
error
function(content) called with details of any error which may occur

forge.display.setStatusBarColor(color, success, error)

Android 5.0+

Set status bar color on supported devices.

Parameters:
color
array an array of three integers in the range [0,255] that make up the RGB color of the statusbar. For example, opaque red is [255, 0, 0].
success
function(value) callback to be invoked when no errors occur
error
function(content) called with details of any error which may occur

forge.display.setStatusBarStyle(style, success, error)

iOS

Set the status bar style on iOS, default will use black text, light_content will use white text.

Parameters:
style
string either "default or "light_content".
success
function() callback to be invoked when no errors occur
error
function(content) called with details of any error which may occur

forge.display.orientation.forceLandscape(success, error)

iOS, Android

Force the app into a landscape orientation.

Parameters:
success
function(value) callback to be invoked when no errors occur
error
function(content) called with details of any error which may occur

forge.display.orientation.forcePortrait(success, error)

iOS, Android

Force the app into a portrait orientation.

Parameters:
success
function(value) callback to be invoked when no errors occur
error
function(content) called with details of any error which may occur

forge.display.orientation.allowAny(success, error)

iOS, Android

Allow any app orientation.

Parameters:
success
function(value) callback to be invoked when no errors occur
error
function(content) called with details of any error which may occur

forge.display.enableWakeLock(success, error)

iOS, Android

Prevent the device from entering sleep mode and disabling the display when your app is active.

Parameters:
success
function(value) callback to be invoked when no errors occur
error
function(content) called with details of any error which may occur

forge.display.disableWakeLock(success, error)

iOS, Android

Remove any active wake lock preventing the device from entering sleep mode when your app is active.

Parameters:
success
function(value) callback to be invoked when no errors occur
error
function(content) called with details of any error which may occur