Class: SoftwareButtonManager

SoftwareButtonManager

new SoftwareButtonManager()

SoftwareButtonManager manages a home button for devices without physical home buttons.

SoftwareButtonManager manages a home button for devices without physical home buttons. The software home button will display at the bottom of the screen in portrait, and on the right in landscape and is meant to function in the same way as a hardware home button.

Source:
Requires:
  • module:ScreenLayout
  • module:SettingsListener

Requires

  • module:ScreenLayout
  • module:SettingsListener

Members

_cacheHeight

Returns the height of the software buttons if device is in portrait, 0 otherwise.

Returns the height of the software buttons if device is in portrait, 0 otherwise.

Source:

_cacheWidth

Returns the width of the software buttons if device is in landscape, 0 otherwise.

Returns the width of the software buttons if device is in landscape, 0 otherwise.

Source:

_currentOrientation :String

The current device orientation.

The current device orientation.

Type:
  • String
Source:

_enabled :Boolean

Whether or not the SoftwareButtonManager is enabled.

Whether or not the SoftwareButtonManager is enabled.

Type:
  • Boolean
Source:

_fullscreenElement :DomElement

The element that entered fullscreen.

The element that entered fullscreen. Saved so that click eventListener can be removed when leaving fullscreen.

Type:
  • DomElement
Source:

_fullscreenTimerId :number

The id of the timer that hides the soft buttons in fullscreen.

The id of the timer that hides the soft buttons in fullscreen. Saved so that the timer can be canceled if the user clicks/taps the screen again.

Type:
  • number
Source:

_fullscreenTouchStart :Touch

The starting position of a touch in fullscreen.

The starting position of a touch in fullscreen. Saved so that we can check whether the user taps or swipes.

Type:
  • Touch
Source:

hasHardwareHomeButton :Boolean

True if the device has a hardware home button.

True if the device has a hardware home button.

Type:
  • Boolean
Source:

overrideFlag :Boolean

Enables the software button if hasHardwareHomeButton is false.

Enables the software button if hasHardwareHomeButton is false.

Type:
  • Boolean
Source:

Methods

_fullscreenTapFunction()

Function to execute when user clicks/taps screen in fullscreen mode.

Function to execute when user clicks/taps screen in fullscreen mode.

Source:

_preventFocus()

Used to prevent taps on the SHB container from stealing focus, and to prevent fuzzing issues where tapping will trigger events in the app.

Used to prevent taps on the SHB container from stealing focus, and to prevent fuzzing issues where tapping will trigger events in the app.

Source:

handleEvent(evt)

General event handler interface.

General event handler interface.

Parameters:
Name Type Description
evt DOMEvent

The event.

Source:

publish(type)

Shortcut to publish a custom software button event.

Shortcut to publish a custom software button event.

Parameters:
Name Type Description
type String

The type of softwareButtonEvent.

Source:

resizeAndDispatchEvent()

Resizes software buttons panel and dispatches events so screens can resize themselves after a change in the state of the software home button.

Resizes software buttons panel and dispatches events so screens can resize themselves after a change in the state of the software home button.

Source:

start()

Starts the SoftwareButtonManager instance.

Starts the SoftwareButtonManager instance.

Source:

toggle()

Toggles the status of the software button.

Toggles the status of the software button.

Source: