From 25849a1425fedd7c17b9ce43d3d7c5fbe98b39be Mon Sep 17 00:00:00 2001 From: Hristo Hristov Date: Fri, 21 Apr 2017 17:57:25 +0300 Subject: [PATCH] implement get/set for selectedBackgroundColor property (#4039) * implement get/set for selectedBackgroundColor property * list-view separator color exposed through style * Style androidStatusBarBackground exposed on Page --- tns-core-modules/ui/list-view/list-view-common.ts | 8 +++++++- tns-core-modules/ui/page/page-common.ts | 8 +++++++- tns-core-modules/ui/page/page.d.ts | 2 +- tns-core-modules/ui/segmented-bar/segmented-bar-common.ts | 8 +++++++- tns-core-modules/ui/segmented-bar/segmented-bar.d.ts | 6 +++--- 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/tns-core-modules/ui/list-view/list-view-common.ts b/tns-core-modules/ui/list-view/list-view-common.ts index 0f886b4f0..e2e3a8eaa 100644 --- a/tns-core-modules/ui/list-view/list-view-common.ts +++ b/tns-core-modules/ui/list-view/list-view-common.ts @@ -40,11 +40,17 @@ export abstract class ListViewBase extends View implements ListViewDefinition { public _itemTemplatesInternal = new Array(this._defaultTemplate); public _effectiveRowHeight: number = autoEffectiveRowHeight; public rowHeight: Length; - public separatorColor: Color; public items: any[] | ItemsSource; public itemTemplate: string | Template; public itemTemplates: string | Array; + get separatorColor(): Color { + return this.style.separatorColor; + } + set separatorColor(value: Color) { + this.style.separatorColor = value; + } + get itemTemplateSelector(): string | ((item: any, index: number, items: any) => string) { return this._itemTemplateSelector; } diff --git a/tns-core-modules/ui/page/page-common.ts b/tns-core-modules/ui/page/page-common.ts index a04bcd3d4..c18da4cc6 100644 --- a/tns-core-modules/ui/page/page-common.ts +++ b/tns-core-modules/ui/page/page-common.ts @@ -35,7 +35,6 @@ export class PageBase extends ContentView implements PageDefinition { public actionBarHidden: boolean; public enableSwipeBackNavigation: boolean; public backgroundSpanUnderStatusBar: boolean; - public androidStatusBarBackground: Color; constructor() { super(); @@ -83,6 +82,13 @@ export class PageBase extends ContentView implements PageDefinition { this.style.statusBarStyle = value; } + public get androidStatusBarBackground(): Color { + return this.style.androidStatusBarBackground; + } + public set androidStatusBarBackground(value: Color) { + this.style.androidStatusBarBackground = value; + } + get page(): PageDefinition { return this; } diff --git a/tns-core-modules/ui/page/page.d.ts b/tns-core-modules/ui/page/page.d.ts index 8d7369cb8..e1a8b2eac 100644 --- a/tns-core-modules/ui/page/page.d.ts +++ b/tns-core-modules/ui/page/page.d.ts @@ -291,4 +291,4 @@ export const statusBarStyleProperty: CssProperty; /** * Property backing androidStatusBarBackground. */ -export const androidStatusBarBackgroundProperty: Property; +export const androidStatusBarBackgroundProperty: CssProperty; diff --git a/tns-core-modules/ui/segmented-bar/segmented-bar-common.ts b/tns-core-modules/ui/segmented-bar/segmented-bar-common.ts index 472bbf67a..54aac5cb7 100644 --- a/tns-core-modules/ui/segmented-bar/segmented-bar-common.ts +++ b/tns-core-modules/ui/segmented-bar/segmented-bar-common.ts @@ -31,8 +31,14 @@ export abstract class SegmentedBarBase extends View implements SegmentedBarDefin public static selectedIndexChangedEvent = "selectedIndexChanged"; public selectedIndex: number; - public selectedBackgroundColor: Color; public items: Array; + + public get selectedBackgroundColor(): Color { + return this.style.selectedBackgroundColor; + } + public set selectedBackgroundColor(value: Color) { + this.style.selectedBackgroundColor = value; + } public _addArrayFromBuilder(name: string, value: Array): void { if (name === "items") { diff --git a/tns-core-modules/ui/segmented-bar/segmented-bar.d.ts b/tns-core-modules/ui/segmented-bar/segmented-bar.d.ts index 1f3bddb8f..11df6addf 100644 --- a/tns-core-modules/ui/segmented-bar/segmented-bar.d.ts +++ b/tns-core-modules/ui/segmented-bar/segmented-bar.d.ts @@ -6,7 +6,7 @@ import { ViewBase, View, AddChildFromBuilder, AddArrayFromBuilder, - Property, CoercibleProperty, EventData, Color + Property, CoercibleProperty, EventData, Color, CssProperty, Style } from "../core/view"; /** @@ -88,9 +88,9 @@ export const selectedIndexProperty: CoercibleProperty; /** * Gets or sets the selected background color property of the SegmentedBar. */ -export const selectedBackgroundColorProperty: Property; +export const selectedBackgroundColorProperty: CssProperty; /** * Gets or sets the items dependency property of the SegmentedBar. */ -export const itemsProperty: Property; +export const itemsProperty: Property; \ No newline at end of file