diff --git a/apps/app/ui-tests-app/tab-view/main-page.ts b/apps/app/ui-tests-app/tab-view/main-page.ts
index 69d4aa857..50f8dca5d 100644
--- a/apps/app/ui-tests-app/tab-view/main-page.ts
+++ b/apps/app/ui-tests-app/tab-view/main-page.ts
@@ -27,5 +27,6 @@ export function loadExamples() {
examples.set("tab-view-tab-text-font-size", "tab-view/tab-view-tab-text-font-size");
examples.set("tab-view-android-swipe", "tab-view/tab-view-android-swipe");
examples.set("tab-view-icon-title-placement", "tab-view/icon-title-placement");
+ examples.set("tab-text-color", "tab-view/tab-text-color");
return examples;
}
diff --git a/apps/app/ui-tests-app/tab-view/tab-text-color.xml b/apps/app/ui-tests-app/tab-view/tab-text-color.xml
new file mode 100644
index 000000000..8f851e60d
--- /dev/null
+++ b/apps/app/ui-tests-app/tab-view/tab-text-color.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/e2e/modal-navigation/app/home/home-page.ts b/e2e/modal-navigation/app/home/home-page.ts
index 54cb458fa..1ce7f9179 100644
--- a/e2e/modal-navigation/app/home/home-page.ts
+++ b/e2e/modal-navigation/app/home/home-page.ts
@@ -1,7 +1,7 @@
import * as application from "tns-core-modules/application";
import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
import { NavigatedData, Page } from "tns-core-modules/ui/page";
-import { View, EventData } from "tns-core-modules/ui/core/view";
+import { View, EventData, ShowModalOptions } from "tns-core-modules/ui/core/view";
import { Frame } from "tns-core-modules/ui/frame";
export function onNavigatingTo(args: NavigatedData) {
@@ -29,6 +29,20 @@ export function onModalNoPage(args: EventData) {
false);
}
+export function onPopoverModal(args: EventData) {
+ const view = args.object as View;
+ let options: ShowModalOptions = {
+ context: "context",
+ closeCallback: () => console.log("home-page modal popover frame closed"),
+ animated: false,
+ ios: {
+ presentationStyle: UIModalPresentationStyle.Popover
+ }
+ }
+
+ view.showModal("modal-no-page/modal-no-page", options);
+}
+
export function onModalFrame(args: EventData) {
const view = args.object as View;
diff --git a/e2e/modal-navigation/app/home/home-page.xml b/e2e/modal-navigation/app/home/home-page.xml
index 67a6197eb..62bfbc778 100644
--- a/e2e/modal-navigation/app/home/home-page.xml
+++ b/e2e/modal-navigation/app/home/home-page.xml
@@ -20,6 +20,7 @@
+
diff --git a/e2e/modal-navigation/app/modal-no-page/modal-no-page.ts b/e2e/modal-navigation/app/modal-no-page/modal-no-page.ts
index 88395c2b7..2652b50bd 100644
--- a/e2e/modal-navigation/app/modal-no-page/modal-no-page.ts
+++ b/e2e/modal-navigation/app/modal-no-page/modal-no-page.ts
@@ -3,7 +3,7 @@ import { NavigatedData, Page } from "tns-core-modules/ui/page";
import { View, EventData } from "tns-core-modules/ui/core/view";
import { Frame, ShownModallyData } from "tns-core-modules/ui/frame";
import { fromObject } from "tns-core-modules/data/observable";
-import { confirm } from "ui/dialogs";
+import { confirm } from "tns-core-modules/ui/dialogs";
export function onLoaded(args) {
console.log("modal-no-page loaded");
diff --git a/e2e/modal-navigation/app/modal/modal-page.ts b/e2e/modal-navigation/app/modal/modal-page.ts
index c191dfe95..6de08686d 100644
--- a/e2e/modal-navigation/app/modal/modal-page.ts
+++ b/e2e/modal-navigation/app/modal/modal-page.ts
@@ -3,7 +3,7 @@ import { NavigatedData, Page } from "tns-core-modules/ui/page";
import { View, EventData } from "tns-core-modules/ui/core/view";
import { Frame, ShownModallyData } from "tns-core-modules/ui/frame";
import { fromObject } from "tns-core-modules/data/observable";
-import { confirm } from "ui/dialogs";
+import { confirm } from "tns-core-modules/ui/dialogs";
export function onShowingModally(args: ShownModallyData) {
console.log("modal-page showingModally");
diff --git a/e2e/modal-navigation/package.json b/e2e/modal-navigation/package.json
index 68db87859..c3ffbd134 100644
--- a/e2e/modal-navigation/package.json
+++ b/e2e/modal-navigation/package.json
@@ -25,6 +25,7 @@
"nativescript-dev-appium": "next",
"nativescript-dev-typescript": "next",
"nativescript-dev-webpack": "next",
+ "tns-platform-declarations": "next",
"rimraf": "^2.6.2",
"typescript": "^3.1.6"
},
diff --git a/e2e/modal-navigation/references.d.ts b/e2e/modal-navigation/references.d.ts
new file mode 100644
index 000000000..b945d69c5
--- /dev/null
+++ b/e2e/modal-navigation/references.d.ts
@@ -0,0 +1 @@
+///
\ No newline at end of file
diff --git a/tns-core-modules/ui/core/view/view-common.ts b/tns-core-modules/ui/core/view/view-common.ts
index a9c627a84..773ff8d60 100644
--- a/tns-core-modules/ui/core/view/view-common.ts
+++ b/tns-core-modules/ui/core/view/view-common.ts
@@ -21,6 +21,7 @@ import {
} from "../../gestures";
import { createViewFromEntry } from "../../builder";
+import { isAndroid } from "../../../platform";
import { StyleScope } from "../../styling/style-scope";
import { LinearGradient } from "../../styling/linear-gradient";
import { BackgroundRepeat } from "../../styling/style-properties";
@@ -368,7 +369,11 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
}
}
- that._hideNativeModalView(parent, whenClosedCallback);
+ if (isAndroid || (parent.viewController && parent.viewController.presentedViewController)) {
+ that._hideNativeModalView(parent, whenClosedCallback);
+ } else {
+ whenClosedCallback();
+ }
}
};
}
diff --git a/tns-core-modules/ui/core/view/view.ios.ts b/tns-core-modules/ui/core/view/view.ios.ts
index c733f9066..99cd1ad43 100644
--- a/tns-core-modules/ui/core/view/view.ios.ts
+++ b/tns-core-modules/ui/core/view/view.ios.ts
@@ -29,6 +29,7 @@ const majorVersion = iosUtils.MajorVersion;
export class View extends ViewCommon {
nativeViewProtected: UIView;
viewController: UIViewController;
+ private _popoverPresentationDelegate: ios.UIPopoverPresentationControllerDelegateImp;
private _isLaidOut = false;
private _hasTransfrom = false;
@@ -416,6 +417,8 @@ export class View extends ViewCommon {
if (presentationStyle === UIModalPresentationStyle.Popover) {
const popoverPresentationController = controller.popoverPresentationController;
+ this._popoverPresentationDelegate = ios.UIPopoverPresentationControllerDelegateImp.initWithOwnerAndCallback(new WeakRef(this), this._closeModalCallback);
+ popoverPresentationController.delegate = this._popoverPresentationDelegate;
const view = parent.nativeViewProtected;
// Note: sourceView and sourceRect are needed to specify the anchor location for the popover.
// Note: sourceView should be the button triggering the modal. If it the Page the popover might appear "behind" the page content
@@ -906,7 +909,7 @@ export namespace ios {
public viewDidLoad(): void {
super.viewDidLoad();
-
+
// Unify translucent and opaque bars layout
// this.edgesForExtendedLayout = UIRectEdgeBottom;
this.extendedLayoutIncludesOpaqueBars = true;
@@ -982,4 +985,26 @@ export namespace ios {
}
}
}
+
+ export class UIPopoverPresentationControllerDelegateImp extends NSObject implements UIPopoverPresentationControllerDelegate {
+ public static ObjCProtocols = [UIPopoverPresentationControllerDelegate];
+
+ private owner: WeakRef;
+ private closedCallback: Function;
+
+ public static initWithOwnerAndCallback(owner: WeakRef, whenClosedCallback: Function): UIPopoverPresentationControllerDelegateImp {
+ const instance = super.new();
+ instance.owner = owner;
+ instance.closedCallback = whenClosedCallback;
+
+ return instance;
+ }
+
+ public popoverPresentationControllerDidDismissPopover(popoverPresentationController: UIPopoverPresentationController) {
+ const owner = this.owner.get();
+ if (owner && typeof this.closedCallback === "function") {
+ this.closedCallback();
+ }
+ }
+ }
}
diff --git a/tns-core-modules/ui/tab-view/tab-view.ios.ts b/tns-core-modules/ui/tab-view/tab-view.ios.ts
index 3201e9a2c..70f8c1f3d 100644
--- a/tns-core-modules/ui/tab-view/tab-view.ios.ts
+++ b/tns-core-modules/ui/tab-view/tab-view.ios.ts
@@ -576,7 +576,7 @@ function getTitleAttributesForStates(tabView: TabView): TabStates {
}
const tabSelectedItemTextColor = tabView.style.selectedTabTextColor;
- const selectedTextColor = tabItemTextColor instanceof Color ? tabSelectedItemTextColor.ios : null;
+ const selectedTextColor = tabSelectedItemTextColor instanceof Color ? tabSelectedItemTextColor.ios : null;
result.selectedState = { [NSFontAttributeName]: font }
if (selectedTextColor) {
result.selectedState[UITextAttributeTextColor] = selectedTextColor