diff --git a/tests/app/application/application-tests-common.ts b/tests/app/application/application-tests-common.ts index 47dc01e94..6d0179eb0 100644 --- a/tests/app/application/application-tests-common.ts +++ b/tests/app/application/application-tests-common.ts @@ -21,3 +21,7 @@ export function testDisplayedEvent() { // global.isDisplayedEventFired flag is set in app.ts application.displayedEvent handler TKUnit.assert((global).isDisplayedEventFired, "application.displayedEvent not fired"); } + +export function testOrientation() { + TKUnit.assert(app.orientation, "Orientation not initialized."); +} diff --git a/tests/app/ui/test-pages/bindingExpressions_logicalComparisonOperators_testPage.xml b/tests/app/ui/test-pages/bindingExpressions_logicalComparisonOperators_testPage.xml index b22a68571..02bd49a90 100644 --- a/tests/app/ui/test-pages/bindingExpressions_logicalComparisonOperators_testPage.xml +++ b/tests/app/ui/test-pages/bindingExpressions_logicalComparisonOperators_testPage.xml @@ -1,7 +1,7 @@  - + - + diff --git a/tns-core-modules/application/application.android.ts b/tns-core-modules/application/application.android.ts index b1d633c62..25e04594b 100644 --- a/tns-core-modules/application/application.android.ts +++ b/tns-core-modules/application/application.android.ts @@ -248,6 +248,10 @@ export function getNativeApplication(): android.app.Application { return nativeApp; } +export function orientation(): "portrait" | "landscape" | "unknown" { + return androidApp.orientation; +} + on(orientationChangedEvent, (args: OrientationChangedEventData) => { const rootView = getRootView(); if (rootView) { diff --git a/tns-core-modules/application/application.d.ts b/tns-core-modules/application/application.d.ts index 672e55cc5..48217c411 100644 --- a/tns-core-modules/application/application.d.ts +++ b/tns-core-modules/application/application.d.ts @@ -285,6 +285,12 @@ export function on(event: "discardedError", callback: (args: DiscardedErrorEvent */ export function on(event: "orientationChanged", callback: (args: OrientationChangedEventData) => void, thisArg?: any); +/** + * Gets the orientation of the application. + * Available values: "portrait", "landscape", "unknown". + */ +export function orientation(): "portrait" | "landscape" | "unknown"; + /** * This is the Android-specific application object instance. * Encapsulates methods and properties specific to the Android platform. diff --git a/tns-core-modules/application/application.ios.ts b/tns-core-modules/application/application.ios.ts index 7cf496b46..60fd1fda8 100644 --- a/tns-core-modules/application/application.ios.ts +++ b/tns-core-modules/application/application.ios.ts @@ -415,6 +415,10 @@ function setViewControllerView(view: View): void { } } +export function orientation(): "portrait" | "landscape" | "unknown" { + return iosApp.orientation; +} + on(orientationChangedEvent, (args: OrientationChangedEventData) => { const rootView = getRootView(); if (rootView) { diff --git a/tns-core-modules/ui/tab-navigation-base/tab-strip/tab-strip.d.ts b/tns-core-modules/ui/tab-navigation-base/tab-strip/tab-strip.d.ts index 22b629890..6df5c81cd 100644 --- a/tns-core-modules/ui/tab-navigation-base/tab-strip/tab-strip.d.ts +++ b/tns-core-modules/ui/tab-navigation-base/tab-strip/tab-strip.d.ts @@ -27,6 +27,11 @@ export class TabStrip extends View { */ iosIconRenderingMode: "automatic" | "alwaysOriginal" | "alwaysTemplate"; + /** + * Gets or sets the color that marks the selected tab of the tab strip. Works for Tabs component only. + */ + highlightColor: Color; + /** * @private */ diff --git a/tns-core-modules/ui/tab-navigation-base/tab-strip/tab-strip.ts b/tns-core-modules/ui/tab-navigation-base/tab-strip/tab-strip.ts index f6654c4c5..deead4fb8 100644 --- a/tns-core-modules/ui/tab-navigation-base/tab-strip/tab-strip.ts +++ b/tns-core-modules/ui/tab-navigation-base/tab-strip/tab-strip.ts @@ -24,6 +24,7 @@ export class TabStrip extends View implements TabStripDefinition, AddChildFromBu public items: TabStripItem[]; public isIconSizeFixed: boolean; public iosIconRenderingMode: "automatic" | "alwaysOriginal" | "alwaysTemplate"; + public highlightColor: Color; public _hasImage: boolean; public _hasTitle: boolean;