diff --git a/apps/app/modaltest/app.css b/apps/app/modaltest/app.css
new file mode 100644
index 000000000..84c63cd1d
--- /dev/null
+++ b/apps/app/modaltest/app.css
@@ -0,0 +1,3 @@
+Button {
+ background-color: red
+}
\ No newline at end of file
diff --git a/apps/app/modaltest/main-page.xml b/apps/app/modaltest/main-page.xml
new file mode 100644
index 000000000..ef80210c1
--- /dev/null
+++ b/apps/app/modaltest/main-page.xml
@@ -0,0 +1,19 @@
+
+
+
+
+ -->
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/app/modaltest/modal-frame.1.xml b/apps/app/modaltest/modal-frame.1.xml
new file mode 100644
index 000000000..39f23da4a
--- /dev/null
+++ b/apps/app/modaltest/modal-frame.1.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/app/modaltest/modal-frame.xml b/apps/app/modaltest/modal-frame.xml
new file mode 100644
index 000000000..c505323de
--- /dev/null
+++ b/apps/app/modaltest/modal-frame.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/app/modaltest/modal-tab.33.xml b/apps/app/modaltest/modal-tab.33.xml
new file mode 100644
index 000000000..879f43090
--- /dev/null
+++ b/apps/app/modaltest/modal-tab.33.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/app/modaltest/modal-tab.css b/apps/app/modaltest/modal-tab.css
new file mode 100644
index 000000000..6807afe57
--- /dev/null
+++ b/apps/app/modaltest/modal-tab.css
@@ -0,0 +1,3 @@
+Button {
+ background-color: white
+}
\ No newline at end of file
diff --git a/apps/app/modaltest/modal-tab.xml b/apps/app/modaltest/modal-tab.xml
new file mode 100644
index 000000000..ca07236f8
--- /dev/null
+++ b/apps/app/modaltest/modal-tab.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/app/modaltest/page.2.xml b/apps/app/modaltest/page.2.xml
new file mode 100644
index 000000000..92ea67ee1
--- /dev/null
+++ b/apps/app/modaltest/page.2.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/app/modaltest/textview.xml b/apps/app/modaltest/textview.xml
new file mode 100644
index 000000000..c337fcca9
--- /dev/null
+++ b/apps/app/modaltest/textview.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tns-core-modules/application/application.ios.ts b/tns-core-modules/application/application.ios.ts
index 443e74350..4fb251b9a 100644
--- a/tns-core-modules/application/application.ios.ts
+++ b/tns-core-modules/application/application.ios.ts
@@ -16,8 +16,8 @@ export * from "./application-common";
// TODO: Remove this and get it from global to decouple builder for angular
import { createViewFromEntry } from "../ui/builder";
-import { ios as iosView, ViewBase } from "../ui/core/view";
-import { Frame, View, NavigationEntry } from "../ui/frame";
+import { ios as iosView, View } from "../ui/core/view";
+import { Frame, NavigationEntry } from "../ui/frame";
import { ios } from "../ui/utils";
import * as utils from "../utils/utils";
import { profile } from "../profiling";
@@ -51,7 +51,7 @@ class IOSApplication implements IOSApplicationDefinition {
private _currentOrientation = utils.ios.getter(UIDevice, UIDevice.currentDevice).orientation;
private _window: UIWindow;
private _observers: Array;
- private _rootView: ViewBase;
+ private _rootView: View;
constructor() {
this._observers = new Array();
@@ -114,18 +114,7 @@ class IOSApplication implements IOSApplicationDefinition {
notify(args);
notify({ eventName: "loadAppCss", object: this, cssFile: getCssFileName() });
- const rootView = createRootView(args.root);
- this._rootView = rootView;
- const controller = getViewController(rootView);
- this._window.rootViewController = controller;
- if (createRootFrame) {
- // Don't setup as styleScopeHost
- rootView._setupUI({});
- } else {
- // setup view as styleScopeHost
- rootView._setupAsRootView({});
- }
- this._window.makeKeyAndVisible();
+ this.setWindowContent(args.root);
}
@profile
@@ -193,12 +182,44 @@ class IOSApplication implements IOSApplicationDefinition {
});
}
}
+
+ public _onLivesync(): void {
+ // If view can't handle livesync set window controller.
+ if (!this._rootView._onLivesync()) {
+ this.setWindowContent();
+ }
+ }
+
+ public setWindowContent(view?: View): void {
+ const rootView = createRootView(view);
+ this._rootView = rootView;
+ const controller = getViewController(rootView);
+
+ if (createRootFrame) {
+ // Don't setup as styleScopeHost
+ rootView._setupUI({});
+ } else {
+ // setup view as styleScopeHost
+ rootView._setupAsRootView({});
+ }
+
+ const haveController = this._window.rootViewController !== null;
+ this._window.rootViewController = controller;
+ if (!haveController) {
+ this._window.makeKeyAndVisible();
+ }
+ }
}
const iosApp = new IOSApplication();
exports.ios = iosApp;
setApplication(iosApp);
+// attach on global, so it can be overwritten in NativeScript Angular
+(global).__onLiveSyncCore = function () {
+ iosApp._onLivesync();
+}
+
let mainEntry: NavigationEntry;
function createRootView(v?: View) {
let rootView = v;
diff --git a/tns-core-modules/ui/core/view-base/view-base.d.ts b/tns-core-modules/ui/core/view-base/view-base.d.ts
index 53baf154a..10f9393c0 100644
--- a/tns-core-modules/ui/core/view-base/view-base.d.ts
+++ b/tns-core-modules/ui/core/view-base/view-base.d.ts
@@ -1,7 +1,6 @@
/**
* @module "ui/core/view-base"
*/ /** */
-
import { Property, CssProperty, CssAnimationProperty, InheritedProperty, Style } from "../properties";
import { BindingOptions, Observable } from "../bindable";
@@ -110,6 +109,37 @@ export abstract class ViewBase extends Observable {
_suspendedUpdates: { [propertyName: string]: Property | CssProperty