@nativescript-community/ui-material-bottomnavigationbar
Version:
Material Design Bottom Navigation bars allow movement between primary destinations in an app. Tapping on a bottom navigation icon takes you directly to the associated view or refreshes the currently active view.
94 lines (93 loc) • 3.19 kB
TypeScript
import { Color, CssProperty, EventData, ImageSource, Property, Style, View } from '@nativescript/core';
/**
* Event interface for tab pressed event
*
* @export
* @interface TabPressedEventData
* @extends {EventData}
*/
export interface TabPressedEventData extends EventData {
index: number;
}
/**
* Event interface for tab selected event
*
* @export
* @interface TabSelectedEventData
* @extends {EventData}
*/
export interface TabSelectedEventData extends EventData {
oldIndex: number;
newIndex: number;
}
/**
* Event interface for tab reselected event
*
* @export
* @interface TabReselectedEventData
* @extends {EventData}
*/
export interface TabReselectedEventData extends EventData {
index: number;
}
/**
* Enum for Title Visibility options
*
* @export
* @enum {number}
*/
export declare enum TitleVisibility {
selected = 0,
always = 1,
never = 2
}
export declare const selectedTabIndexProperty: any;
export declare abstract class BottomNavigationBarBase extends View {
static tabPressedEvent: string;
static tabSelectedEvent: string;
static tabReselectedEvent: string;
activeColor: Color;
inactiveColor: Color;
badgeColor: Color;
badgeTextColor: Color;
selectedTabIndex: number;
titleVisibility: TitleVisibility;
autoClearBadge: boolean;
protected _items: BottomNavigationTabBase[];
get items(): BottomNavigationTabBase[];
onLoaded(): void;
selectTab(index: number): void;
_emitTabPressed(index: number): void;
_emitTabSelected(index: number): void;
_emitTabReselected(index: number): void;
_addChildFromBuilder(name: string, value: BottomNavigationTabBase): void;
showBadge(index: number, value?: number): void;
removeBadge(index: number): void;
protected abstract selectTabNative(index: number): void;
protected abstract createTabs(tabs: BottomNavigationTabBase[] | undefined): void;
onSelectedTabIndexChanged(oldIndex: number, newIndex: number): void;
}
export declare const tabsProperty: Property<BottomNavigationBarBase, BottomNavigationTabBase[]>;
export declare const titleVisibilityProperty: Property<BottomNavigationBarBase, TitleVisibility>;
export declare const autoClearBadgeProperty: Property<BottomNavigationBarBase, boolean>;
export declare const activeColorCssProperty: CssProperty<Style, Color>;
export declare const inactiveColorCssProperty: CssProperty<Style, Color>;
export declare const badgeColorCssProperty: CssProperty<Style, Color>;
export declare const badgeTextColorCssProperty: CssProperty<Style, Color>;
interface BottomNavigationTabProps {
title: string;
icon: string | ImageSource;
isSelectable?: boolean;
}
export declare abstract class BottomNavigationTabBase extends View implements BottomNavigationTabProps {
title: string;
icon: string | ImageSource;
isSelectable?: boolean;
activeColor: Color;
inactiveColor: Color;
abstract showBadge(value?: number): void;
abstract removeBadge(): void;
}
export declare const isSelectableProperty: Property<BottomNavigationTabBase, boolean>;
export declare const iconProperty: Property<BottomNavigationTabBase, ImageSource>;
export {};