mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(bottom-navigation-android): add tabstripitem css support (#7458)
* wip: add background color placeholders for tabstripitem * feat: add css for tabstripitem for bottom navigation android * chore: update example * fix: revert native default index * clean up tabcontentitem * update setTabBarItemTextTransform * textTransform inherited css property now * fix(android-bottom-navigation): fragment detach logic * chore: fix tests * fix(android-bottom-navigation): fragment lifecycle logic * fix: revert text-transform inherited css property
This commit is contained in:
committed by
Manol Donev
parent
6e1e0e843a
commit
fab9c90007
@@ -3,10 +3,10 @@ import { TabStrip as TabStripDefinition } from ".";
|
||||
import { TabStripItem } from "../tab-strip-item";
|
||||
import { TabNavigationBase } from "../tab-navigation-base";
|
||||
import { Color } from "../../../color";
|
||||
import { AddArrayFromBuilder, AddChildFromBuilder } from "../../core/view";
|
||||
import { ViewBase, AddArrayFromBuilder, AddChildFromBuilder } from "../../core/view";
|
||||
|
||||
// Requires
|
||||
import { View, Property, CSSType, backgroundColorProperty, backgroundInternalProperty } from "../../core/view";
|
||||
import { View, Property, CSSType, backgroundColorProperty, backgroundInternalProperty, colorProperty } from "../../core/view";
|
||||
|
||||
export const traceCategory = "TabView";
|
||||
|
||||
@@ -15,6 +15,15 @@ export class TabStrip extends View implements TabStripDefinition, AddChildFromBu
|
||||
public items: TabStripItem[];
|
||||
public iosIconRenderingMode: "automatic" | "alwaysOriginal" | "alwaysTemplate";
|
||||
|
||||
public eachChild(callback: (child: ViewBase) => boolean) {
|
||||
const items = this.items;
|
||||
if (items) {
|
||||
items.forEach((item, i) => {
|
||||
callback(item);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public _addArrayFromBuilder(name: string, value: Array<any>) {
|
||||
if (name === "items") {
|
||||
this.items = value;
|
||||
@@ -49,6 +58,17 @@ export class TabStrip extends View implements TabStripDefinition, AddChildFromBu
|
||||
[backgroundInternalProperty.setNative](value: any) {
|
||||
// disable the background CSS properties
|
||||
}
|
||||
|
||||
[colorProperty.getDefault](): Color {
|
||||
const parent = <TabNavigationBase>this.parent;
|
||||
|
||||
return parent && parent.getTabBarColor();
|
||||
}
|
||||
[colorProperty.setNative](value: Color) {
|
||||
const parent = <TabNavigationBase>this.parent;
|
||||
|
||||
return parent && parent.setTabBarColor(value);
|
||||
}
|
||||
}
|
||||
|
||||
export const iosIconRenderingModeProperty = new Property<TabStrip, "automatic" | "alwaysOriginal" | "alwaysTemplate">({ name: "iosIconRenderingMode", defaultValue: "automatic" });
|
||||
|
||||
Reference in New Issue
Block a user