Skip to content

Commit 25849a1

Browse files
author
Hristo Hristov
authored
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
1 parent c7c0ea7 commit 25849a1

File tree

5 files changed

+25
-7
lines changed

5 files changed

+25
-7
lines changed

tns-core-modules/ui/list-view/list-view-common.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,17 @@ export abstract class ListViewBase extends View implements ListViewDefinition {
4040
public _itemTemplatesInternal = new Array<KeyedTemplate>(this._defaultTemplate);
4141
public _effectiveRowHeight: number = autoEffectiveRowHeight;
4242
public rowHeight: Length;
43-
public separatorColor: Color;
4443
public items: any[] | ItemsSource;
4544
public itemTemplate: string | Template;
4645
public itemTemplates: string | Array<KeyedTemplate>;
4746

47+
get separatorColor(): Color {
48+
return this.style.separatorColor;
49+
}
50+
set separatorColor(value: Color) {
51+
this.style.separatorColor = value;
52+
}
53+
4854
get itemTemplateSelector(): string | ((item: any, index: number, items: any) => string) {
4955
return this._itemTemplateSelector;
5056
}

tns-core-modules/ui/page/page-common.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export class PageBase extends ContentView implements PageDefinition {
3535
public actionBarHidden: boolean;
3636
public enableSwipeBackNavigation: boolean;
3737
public backgroundSpanUnderStatusBar: boolean;
38-
public androidStatusBarBackground: Color;
3938

4039
constructor() {
4140
super();
@@ -83,6 +82,13 @@ export class PageBase extends ContentView implements PageDefinition {
8382
this.style.statusBarStyle = value;
8483
}
8584

85+
public get androidStatusBarBackground(): Color {
86+
return this.style.androidStatusBarBackground;
87+
}
88+
public set androidStatusBarBackground(value: Color) {
89+
this.style.androidStatusBarBackground = value;
90+
}
91+
8692
get page(): PageDefinition {
8793
return this;
8894
}

tns-core-modules/ui/page/page.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,4 +291,4 @@ export const statusBarStyleProperty: CssProperty<Style, "light" | "dark">;
291291
/**
292292
* Property backing androidStatusBarBackground.
293293
*/
294-
export const androidStatusBarBackgroundProperty: Property<Page, Color>;
294+
export const androidStatusBarBackgroundProperty: CssProperty<Style, Color>;

tns-core-modules/ui/segmented-bar/segmented-bar-common.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ export abstract class SegmentedBarBase extends View implements SegmentedBarDefin
3131
public static selectedIndexChangedEvent = "selectedIndexChanged";
3232

3333
public selectedIndex: number;
34-
public selectedBackgroundColor: Color;
3534
public items: Array<SegmentedBarItemDefinition>;
35+
36+
public get selectedBackgroundColor(): Color {
37+
return this.style.selectedBackgroundColor;
38+
}
39+
public set selectedBackgroundColor(value: Color) {
40+
this.style.selectedBackgroundColor = value;
41+
}
3642

3743
public _addArrayFromBuilder(name: string, value: Array<any>): void {
3844
if (name === "items") {

tns-core-modules/ui/segmented-bar/segmented-bar.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import {
88
ViewBase, View, AddChildFromBuilder, AddArrayFromBuilder,
9-
Property, CoercibleProperty, EventData, Color
9+
Property, CoercibleProperty, EventData, Color, CssProperty, Style
1010
} from "../core/view";
1111

1212
/**
@@ -88,9 +88,9 @@ export const selectedIndexProperty: CoercibleProperty<SegmentedBar, number>;
8888
/**
8989
* Gets or sets the selected background color property of the SegmentedBar.
9090
*/
91-
export const selectedBackgroundColorProperty: Property<SegmentedBar, Color>;
91+
export const selectedBackgroundColorProperty: CssProperty<Style, Color>;
9292

9393
/**
9494
* Gets or sets the items dependency property of the SegmentedBar.
9595
*/
96-
export const itemsProperty: Property<SegmentedBar, SegmentedBarItem[]>;
96+
export const itemsProperty: Property<SegmentedBar, SegmentedBarItem[]>;

0 commit comments

Comments
 (0)