Application orientation changed event

This commit is contained in:
vakrilov
2015-07-29 11:43:12 +03:00
parent 5b2679717e
commit 6ebd488735
19 changed files with 274 additions and 66 deletions

View File

@@ -45,6 +45,11 @@ declare module "application" {
*/
export var lowMemoryEvent: string;
/**
* String value used when hooking to orientationChanged event.
*/
export var orientationChangedEvent: string;
/**
* Event data containing information for the application events.
*/
@@ -70,6 +75,16 @@ declare module "application" {
object: any;
}
/**
* Event data containing information for orientation changed event.
*/
export interface OrientationChangedEventData extends ApplicationEventData {
/**
* New orientation value.
*/
newValue: string;
}
/**
* The main page path (without the file extension) for the application starting from the application root.
* For example if you have page called "main.js" in a folder called "subFolder" and your root folder is "app" you can specify mainModule like this:
@@ -146,6 +161,14 @@ declare module "application" {
*/
export function on(eventNames: string, callback: (data: any) => void, thisArg?: any);
/**
* Shortcut alias to the removeEventListener method.
* @param eventNames - String corresponding to events (e.g. "onLaunch").
* @param callback - Callback function which will be removed.
* @param thisArg - An optional parameter which will be used as `this` context for callback execution.
*/
export function off(eventNames: string, callback ?: any, thisArg ?: any);
/**
* Notifies all the registered listeners for the event provided in the data.eventName.
* @param data The data associated with the event.
@@ -188,6 +211,11 @@ declare module "application" {
*/
export function on(event: "uncaughtError", callback: (args: ApplicationEventData) => void, thisArg?: any);
/**
* This event is raised the orientation of the current device has changed.
*/
export function on(event: "orientationChanged", callback: (args: OrientationChangedEventData) => void, thisArg?: any);
/**
* This is the Android-specific application object instance.
* Encapsulates methods and properties specific to the Android platform.