Files
NativeScript/nativescript-core/ui/tab-navigation-base/tab-strip/tab-strip.d.ts
Vasil Trifonov 243dc98005 Added selectedItemColor and unSelectedItemColor to the TabStrip (#8431)
* chore: add guard for ios

* feat(bottom-nav): adding new properties

* feat(tabs): new property implementation

* feat: new feature implementation in android

Implemented selectedItemColor and unSelectedItemColor properties on TabStrip

* chore: added some comments

* chore: change method return type

* fix: setting icon color

* fix: rendering mode setting

* chore: rename variable

* chore: fixed a typo

* chore: updated log in build gradle

* fix: item color setting in android

* fix: tab styling when no css aplied

* chore: private methods renamed

* tests: added selected-item test pages

* chore: renamed test pages

* chore: move css-tree package to the right place

* tests: added new ui tests

* fix: use renamed function

* fix: set item color

* tests: aded automationText attribute

* tests: trying to fix the tests

Co-authored-by: Dimitar Topuzov <dtopuzov@gmail.com>
2020-03-16 12:54:30 +02:00

87 lines
2.6 KiB
TypeScript

/**
* Contains the TabStrip class, which represents a tab strip for tab navigation.
* @module "ui/tab-navigation/tab-strip"
*/ /** */
import { Color } from "../../../color";
import { EventData, Property, View } from "../../core/view";
import { TabStripItem } from "../tab-strip-item";
/**
* Represents a tab strip.
*/
export class TabStrip extends View {
/**
* Gets or sets the items of the tab strip.
*/
items: Array<TabStripItem>;
/**
* Gets or sets whether icon size should be fixed based on specs or use the actual size. Defaults to true(fixed).
*/
isIconSizeFixed: boolean;
/**
* Gets or sets the icon rendering mode on iOS
*/
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;
/**
* Gets or sets the color of the selected item in the tab strip.
*/
selectedItemColor: Color;
/**
* Gets or sets the color of the non-selected items in the tab strip.
*/
unSelectedItemColor: Color;
/**
* @private
*/
_hasImage: boolean;
/**
* @private
*/
_hasTitle: boolean;
/**
* String value used when hooking to itemTap event.
*/
public static itemTapEvent: string;
/**
* A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
* @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
* @param callback - Callback function which will be executed when event is raised.
* @param thisArg - An optional parameter which will be used as `this` context for callback execution.
*/
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any);
/**
* Raised when an TabStripItem is tapped.
*/
on(event: "itemTap", callback: (args: TabStripItemEventData) => void, thisArg?: any);
}
/**
* Event data containing information for the TabStripItem's index.
*/
export interface TabStripItemEventData extends EventData {
/**
* The index of the TabStripItem.
*/
index: number;
}
export const iosIconRenderingModeProperty: Property<TabStrip, "automatic" | "alwaysOriginal" | "alwaysTemplate">;
export const isIconSizeFixedProperty: Property<TabStrip, boolean>;
export const selectedItemColorProperty: Property<TabStrip, Color>;
export const unSelectedItemColorProperty: Property<TabStrip, Color>;