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

@@ -11,14 +11,15 @@ var callbacks = android.app.Application.ActivityLifecycleCallbacks;
export var mainModule: string;
export var androidActivityCreatedEvent = "androidActivityCreated";
export var androidActivityDestroyedEvent = "androidActivityDestroyed";
export var androidActivityStartedEvent = "androidActivityStarted";
export var androidActivityPausedEvent = "androidActivityPaused";
export var androidActivityResumedEvent = "androidActivityResumed";
export var androidActivityStoppedEvent = "androidActivityStopped";
export var androidSaveActivityStateEvent = "androidSaveActivityState";
export var androidActivityResultEvent = "androidActivityResult";
export var androidActivityCreatedEvent = "activityCreated";
export var androidActivityDestroyedEvent = "activityDestroyed";
export var androidActivityStartedEvent = "activityStarted";
export var androidActivityPausedEvent = "activityPaused";
export var androidActivityResumedEvent = "activityResumed";
export var androidActivityStoppedEvent = "activityStopped";
export var androidSaveActivityStateEvent = "saveActivityState";
export var androidActivityResultEvent = "activityResult";
export var androidActivityBackPressedEvent = "activityBackPressed";
// We are using the exports object for the common events since we merge the appModule with this module's exports, which is what users will receive when require("application") is called;
// TODO: This is kind of hacky and is "pure JS in TypeScript"
@@ -163,7 +164,6 @@ class AndroidApplication implements dts.AndroidApplication {
public onActivityResumed: (activity: android.app.Activity) => void;
public onActivityStopped: (activity: android.app.Activity) => void;
public onSaveActivityState: (activity: android.app.Activity, bundle: android.os.Bundle) => void;
public onActivityResult: (requestCode: number, resultCode: number, data: android.content.Intent) => void;
private _eventsToken: any;