From 9fc143ee0304d66200200cdc78251def97ad3cf3 Mon Sep 17 00:00:00 2001 From: Rossen Hristov Date: Mon, 24 Oct 2016 11:10:15 +0300 Subject: [PATCH] Add support for TabView CSS TabView { tab-text-color: green; tab-background-color: yellow; selected-tab-text-color: red; android-selected-tab-highlight-color: orange; text-transform: uppercase; } --- apps/app/ui-tests-app/css/main-page.ts | 1 + apps/app/ui-tests-app/css/tab-view.ts | 13 ++ apps/app/ui-tests-app/css/tab-view.xml | 32 ++++ tns-core-modules/ui/styling/style.d.ts | 11 ++ tns-core-modules/ui/styling/style.ts | 49 ++++- tns-core-modules/ui/styling/styling.d.ts | 21 +++ .../ui/tab-view/tab-view-common.ts | 65 +++++-- .../ui/tab-view/tab-view.android.ts | 178 ++++++++++++------ tns-core-modules/ui/tab-view/tab-view.d.ts | 30 ++- tns-core-modules/ui/tab-view/tab-view.ios.ts | 136 +++++++++---- tns-core-modules/utils/utils.android.ts | 2 +- tns-core-modules/utils/utils.d.ts | 1 + .../android/org.nativescript.widgets.d.ts | 5 + 13 files changed, 427 insertions(+), 117 deletions(-) create mode 100644 apps/app/ui-tests-app/css/tab-view.ts create mode 100644 apps/app/ui-tests-app/css/tab-view.xml diff --git a/apps/app/ui-tests-app/css/main-page.ts b/apps/app/ui-tests-app/css/main-page.ts index 4a6eaabc0..27a848600 100644 --- a/apps/app/ui-tests-app/css/main-page.ts +++ b/apps/app/ui-tests-app/css/main-page.ts @@ -36,6 +36,7 @@ export function pageLoaded(args: EventData) { examples.set("all-uniform-border", "css/all-uniform-border"); examples.set("all-non-uniform-border", "css/all-non-uniform-border"); //examples.set("border-playground", "css/border-playground"); + examples.set("tab-view", "css/tab-view"); let viewModel = new SubMianPageViewModel(wrapLayout, examples); page.bindingContext = viewModel; diff --git a/apps/app/ui-tests-app/css/tab-view.ts b/apps/app/ui-tests-app/css/tab-view.ts new file mode 100644 index 000000000..5de5cf1a8 --- /dev/null +++ b/apps/app/ui-tests-app/css/tab-view.ts @@ -0,0 +1,13 @@ +import view = require("ui/core/view"); +import pages = require("ui/page"); + +export function applyTap(args) { + var page = (args.object).page; + var css = "#test-element { " + args.object.tag + " }"; + page.css = css; +} + +export function resetTap(args) { + var page = (args.object).page; + page.css = ""; +} \ No newline at end of file diff --git a/apps/app/ui-tests-app/css/tab-view.xml b/apps/app/ui-tests-app/css/tab-view.xml new file mode 100644 index 000000000..6cb199fd4 --- /dev/null +++ b/apps/app/ui-tests-app/css/tab-view.xml @@ -0,0 +1,32 @@ + + + + + + +