mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
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
This commit is contained in:
@@ -40,11 +40,17 @@ export abstract class ListViewBase extends View implements ListViewDefinition {
|
||||
public _itemTemplatesInternal = new Array<KeyedTemplate>(this._defaultTemplate);
|
||||
public _effectiveRowHeight: number = autoEffectiveRowHeight;
|
||||
public rowHeight: Length;
|
||||
public separatorColor: Color;
|
||||
public items: any[] | ItemsSource;
|
||||
public itemTemplate: string | Template;
|
||||
public itemTemplates: string | Array<KeyedTemplate>;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
2
tns-core-modules/ui/page/page.d.ts
vendored
2
tns-core-modules/ui/page/page.d.ts
vendored
@@ -291,4 +291,4 @@ export const statusBarStyleProperty: CssProperty<Style, "light" | "dark">;
|
||||
/**
|
||||
* Property backing androidStatusBarBackground.
|
||||
*/
|
||||
export const androidStatusBarBackgroundProperty: Property<Page, Color>;
|
||||
export const androidStatusBarBackgroundProperty: CssProperty<Style, Color>;
|
||||
|
||||
@@ -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<SegmentedBarItemDefinition>;
|
||||
|
||||
public get selectedBackgroundColor(): Color {
|
||||
return this.style.selectedBackgroundColor;
|
||||
}
|
||||
public set selectedBackgroundColor(value: Color) {
|
||||
this.style.selectedBackgroundColor = value;
|
||||
}
|
||||
|
||||
public _addArrayFromBuilder(name: string, value: Array<any>): void {
|
||||
if (name === "items") {
|
||||
|
||||
@@ -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<SegmentedBar, number>;
|
||||
/**
|
||||
* Gets or sets the selected background color property of the SegmentedBar.
|
||||
*/
|
||||
export const selectedBackgroundColorProperty: Property<SegmentedBar, Color>;
|
||||
export const selectedBackgroundColorProperty: CssProperty<Style, Color>;
|
||||
|
||||
/**
|
||||
* Gets or sets the items dependency property of the SegmentedBar.
|
||||
*/
|
||||
export const itemsProperty: Property<SegmentedBar, SegmentedBarItem[]>;
|
||||
export const itemsProperty: Property<SegmentedBar, SegmentedBarItem[]>;
|
||||
Reference in New Issue
Block a user