new HomeGesture()
HomeGesture is used as an alternative to the software home button for devices without physical home buttons.
HomeGesture is used as an alternative to the software home button for devices without physical home buttons. HomeGesture will trigger a 'home' event for a single swipe from the bottom and a 'holdhome' event with a two-finger swipe from the bottom.
- Source:
Requires:
- module:ScreenLayout
- module:SettingsListener
Requires
- module:ScreenLayout
- module:SettingsListener
Members
_moving :Boolean
True when the user starts the home gesture.
True when the user starts the home gesture.
Type:
- Boolean
- Source:
_multiTouch :Boolean
True when the user is swiping with two or more fingers.
True when the user is swiping with two or more fingers.
Type:
- Boolean
- Source:
_startY1 :Integer
The position of the touchstart event.
The position of the touchstart event.
Type:
- Integer
- Source:
enabled :Boolean
Whether or not the HomeGesture is enabled.
Whether or not the HomeGesture is enabled.
Type:
- Boolean
- Source:
MINUMUM_DISTANCE :Integer
Minimum moving distance to home in pixel of screen height
.Minimum moving distance to home in pixel of screen height
Type:
- Integer
- Source:
Methods
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 event.
Shortcut to publish a custom event.
Parameters:
Name | Type | Description |
---|---|---|
type |
String | The event type. |
- Source:
start(enable)
Starts the HomeGesture instance.
Starts the HomeGesture instance.
Parameters:
Name | Type | Description |
---|---|---|
enable |
Boolean | Whether or not the HomeGesture is enabled. |
- Source:
toggle(enable)
Toggles the state of the HomeGesture.
Toggles the state of the HomeGesture.
Parameters:
Name | Type | Description |
---|---|---|
enable |
Boolean | Whether or not the HomeGesture is enabled. |
- Source: