Resolved Issue #391: Added cancellable Android activityBackPressed event + fixed the names of the other activity events because they were wrong.

This commit is contained in:
Rossen Hristov
2015-07-06 11:54:45 +03:00
parent 95b616edb3
commit 7a197a6711
4 changed files with 46 additions and 9 deletions

View File

@@ -250,6 +250,16 @@ declare module "application" {
intent: android.content.Intent;
}
/**
* Data for the Android activity back pressed event.
*/
export interface AndroidActivityBackPressedEventData extends AndroidActivityEventData {
/**
* In the event handler, set this value to true if you want to cancel the back navigation and do something else instead.
*/
cancel: boolean;
}
/**
* This event is raised on android application ActivityCreated.
*/
@@ -290,6 +300,11 @@ declare module "application" {
*/
export function on(event: "activityResult", callback: (args: AndroidActivityResultEventData) => void, thisArg?: any);
/**
* This event is raised on the back button is pressed in an android application.
*/
export function on(event: "activityBackPressed", callback: (args: AndroidActivityBackPressedEventData) => void, thisArg?: any);
/**
* String value used when hooking to ActivityCreated event.
*/
@@ -330,6 +345,11 @@ declare module "application" {
*/
export var androidActivityResultEvent: string;
/**
* String value used when hooking to ActivityBackPressed event.
*/
export var androidActivityBackPressedEvent: string;
/**
* The abstraction of an Android-specific application object.
*/