Added an option to change the rootView.

Fixed crash where activity was incorrectly using existing initialized frame.
Fixed TabView to use _nativeView instead of Frame.
This commit is contained in:
Hristo Hristov
2016-02-05 15:09:02 +02:00
parent c865728001
commit e709485bb6
14 changed files with 415 additions and 289 deletions

View File

@@ -5,7 +5,7 @@ declare module "application" {
import cssSelector = require("ui/styling/css-selector");
import observable = require("data/observable");
import frame = require("ui/frame");
import {View} from "ui/core/view";
/**
* An extended JavaScript Error which will have the nativeError property initialized in case the error is caused by executing platform-specific code.
*/
@@ -76,6 +76,17 @@ declare module "application" {
object: any;
}
/**
* Event data containing information for launch event.
*/
export interface LaunchEventData extends ApplicationEventData {
/**
* The root view for this Window on iOS or Activity for Android.
* If not set a new Frame will be created as a root view in order to maintain backwards compatibility.
*/
root?: View;
}
/**
* Event data containing information for orientation changed event.
*/
@@ -130,7 +141,7 @@ declare module "application" {
/**
* The main entry point event. This method is expected to use the root frame to navigate to the main application page.
*/
export function onLaunch(context: any): void;
export function onLaunch(context?: any): void;
/**
* A callback to be used when an uncaught error occurs while the application is running.
@@ -174,7 +185,7 @@ declare module "application" {
* @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);
export function off(eventNames: string, callback?: any, thisArg?: any);
/**
* Notifies all the registered listeners for the event provided in the data.eventName.
@@ -191,7 +202,7 @@ declare module "application" {
/**
* This event is raised on application launchEvent.
*/
export function on(event: "launch", callback: (args: ApplicationEventData) => void, thisArg?: any);
export function on(event: "launch", callback: (args: LaunchEventData) => void, thisArg?: any);
/**
* This event is raised when the Application is suspended.