From 540b2b4f8206660980e4f0a8eb62a3c06dca1ec6 Mon Sep 17 00:00:00 2001 From: Nicu Date: Thu, 13 Dec 2018 17:03:25 +0200 Subject: [PATCH] feat(view): added iOS parameter for modal presentation style (#6409) * feat(view): added iOS parameter for modal presentation style * Now passing options to showModal in one argument * refactor: Move context and close in modal options * chore: Comments added for UIModalPresentationStyle.Popover case * refactor: Use modalOptions in e2e demo * chore: fix pbroken test --- .../app/ui-tests-app/modal-view/modal-view.ts | 63 ++++--- tests/app/ui/page/page-tests-common.ts | 162 ++++++++++++------ .../ui/core/view-base/view-base.d.ts | 59 ++++++- tns-core-modules/ui/core/view/view-common.ts | 51 ++++-- tns-core-modules/ui/core/view/view.android.ts | 11 +- tns-core-modules/ui/core/view/view.ios.ts | 26 ++- 6 files changed, 264 insertions(+), 108 deletions(-) diff --git a/apps/app/ui-tests-app/modal-view/modal-view.ts b/apps/app/ui-tests-app/modal-view/modal-view.ts index dec7ab7ab..9b570d05f 100644 --- a/apps/app/ui-tests-app/modal-view/modal-view.ts +++ b/apps/app/ui-tests-app/modal-view/modal-view.ts @@ -1,46 +1,61 @@ import { Page } from "tns-core-modules/ui/page"; import { Label } from "tns-core-modules/ui/label"; +function createCloseCallback(label: Label, context?: string): (username: string, password: string) => void { + return function (username: string, password: string) { + let result = username + "/" + password; + result = context ? context + "/" + result : result; + console.log(result); + label.text = result; + } +} + +function openModal(page: Page, label: Label, context: string) { + page.showModal("ui-tests-app/modal-view/login-page", { + context, + closeCallback: createCloseCallback(label, context), + fullscreen: false, + }); +} + export function onTap(args) { const page = args.object.page; const label = page.getViewById