Skip to content

Commit

Permalink
chore: rename to bottom-navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Jan 18, 2021
1 parent 426f71d commit a508148
Show file tree
Hide file tree
Showing 14 changed files with 605 additions and 290 deletions.
2 changes: 1 addition & 1 deletion demo-vue/app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { install as installBottomSheet } from '@nativescript-community/ui-materi
import BottomSheetPlugin from '@nativescript-community/ui-material-bottomsheet/vue';
import BottomNavigationBarPlugin from '@nativescript-community/ui-material-bottomnavigationbar/vue';
import TabsPlugin from '@nativescript-community/ui-material-tabs/vue';
import BottomNavigationPlugin from '@nativescript-community/ui-material-bottomnavigation/vue';
import BottomNavigationPlugin from '@nativescript-community/ui-material-bottom-navigation/vue';
import SpeedDialPlugin from '@nativescript-community/ui-material-speeddial/vue';

installBottomSheet();
Expand Down
2 changes: 1 addition & 1 deletion demo-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@nativescript/core": "7.0.13",
"@nativescript-community/text": "1.3.6",
"@nativescript-community/ui-material-activityindicator": "file:../packages/activityindicator",
"@nativescript-community/ui-material-bottomnavigation": "file:../packages/bottomnavigation",
"@nativescript-community/ui-material-bottom-navigation": "file:../packages/bottom-navigation",
"@nativescript-community/ui-material-bottomnavigationbar": "file:../packages/bottomnavigationbar",
"@nativescript-community/ui-material-bottomsheet": "file:../packages/bottomsheet",
"@nativescript-community/ui-material-button": "file:../packages/button",
Expand Down
File renamed without changes.
216 changes: 216 additions & 0 deletions packages/bottom-navigation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
[![npm](https://img.shields.io/npm/v/nativescript-material-bottom-navigation.svg)](https://www.npmjs.com/package/nativescript-material-bottom-navigation)
[![npm](https://img.shields.io/npm/dt/nativescript-material-bottom-navigation.svg?label=npm%20downloads)](https://www.npmjs.com/package/nativescript-material-bottom-navigation)
[![GitHub forks](https://img.shields.io/github/forks/Akylas/nativescript-material-components.svg)](https://github.com/Akylas/nativescript-material-components/network)
[![GitHub stars](https://img.shields.io/github/stars/Akylas/nativescript-material-components.svg)](https://github.com/Akylas/nativescript-material-components/stargazers)

## Installation

### Warning :warning: :warning:
From 5.x using material component will break N tab component on iOS (which is bound to be removed). This is needed to allow using the latest native iOS features. If needed you can use either [bottomnavigationbar](https://www.npmjs.com/package/nativescript-material-bottomnavigationbar) (this one is the best choice, closest to material design) or [tabs](https://www.npmjs.com/package/nativescript-material-bottom-navigation) (clone of N one, but with a little less features)

* `tns plugin add @nativescript-community/ui-material-bottom-navigation`

Be sure to run a new build after adding plugins to avoid any issues.

---

##### [Material Design Spec](https://material.io/design/components/bottom-navigation.html)

### Usage


## Plain NativeScript

<span style="color:red">IMPORTANT: </span>_Make sure you include `xmlns:mds="@nativescript-community/ui-material-bottom-navigation"` on the Page element_

### XML

```XML
<Page xmlns:mdt="@nativescript-community/ui-material-bottom-navigation">
<mdt:Tabs selectedIndex="1">
<!-- The bottom tab UI is created via TabStrip (the containier) and TabStripItem (for each tab)-->
<MDTabStrip>
<MDTabStripItem>
<Label text="Home"></Label>
<Image src="font://&#xf015;" class="fas"></Image>
</TabStripItem>
<TabStripItem class="special">
<Label text="Account"></Label>
<Image src="font://&#xf007;" class="fas"></Image>
</TabStripItem>
<TabStripItem class="special">
<Label text="Search"></Label>
<Image src="font://&#xf00e;" class="fas"></Image>
</TabStripItem>
</TabStrip>

<!-- The number of TabContentItem components should corespond to the number of TabStripItem components -->
<MDTabContentItem>
<GridLayout>
<Label text="Home Page" class="h2 text-center"></Label>
</GridLayout>
</TabContentItem>
<MDTabContentItem>
<GridLayout>
<Label text="Account Page" class="h2 text-center"></Label>
</GridLayout>
</TabContentItem>
<MDTabContentItem>
<GridLayout>
<Label text="Search Page" class="h2 text-center"></Label>
</GridLayout>
</TabContentItem>
</Tabs>
</Page>
```

### CSS

```CSS
MDBottomNavigation.bottom-nav {
background-color: orangered;
color: gold;
font-size: 18;
}

TabStripItem.tabstripitem-active {
background-color: teal;
}

TabStripItem.tabstripitem-active:active {
background-color: yellowgreen;
}

TabContentItem.first-tabcontent {
background-color: seashell;
color: olive;
}
TabContentItem.second-tabcontent {
background-color: slategray;
color: aquamarine;
}
TabContentItem.third-tabcontent {
background-color: blueviolet;
color: antiquewhite;
}
MDBottomNavigation TabStrip {
highlight-color: red;
}
```

## NativeScript + Angular

```typescript
import { NativeScriptMaterialTabsModule } from "@nativescript-community/ui-material-slider/angular";

@NgModule({
imports: [
NativeScriptMaterialTabsModule,
...
],
...
})
```

```html
<MDBottomNavigation selectedIndex="1">
<!-- The bottom tab UI is created via TabStrip (the containier) and TabStripItem (for each tab)-->
<MDTabStrip>
<MDTabStripItem>
<Label text="Home"></Label>
<Image src="font://&#xf015;" class="fas"></Image>
</TabStripItem>
<TabStripItem class="special">
<Label text="Account"></Label>
<Image src="font://&#xf007;" class="fas"></Image>
</TabStripItem>
<TabStripItem class="special">
<Label text="Search"></Label>
<Image src="font://&#xf00e;" class="fas"></Image>
</TabStripItem>
</TabStrip>

<!-- The number of TabContentItem components should corespond to the number of TabStripItem components -->
<MDTabContentItem>
<GridLayout>
<Label text="Home Page" class="h2 text-center"></Label>
</GridLayout>
</TabContentItem>
<MDTabContentItem>
<GridLayout>
<Label text="Account Page" class="h2 text-center"></Label>
</GridLayout>
</TabContentItem>
<MDTabContentItem>
<GridLayout>
<Label text="Search Page" class="h2 text-center"></Label>
</GridLayout>
</TabContentItem>
</MDBottomNavigation>
```

## NativeScript + Vue

```javascript
import BottomNavigation from '@nativescript-community/ui-material-bottom-navigation/vue';

Vue.use(BottomNavigation);
```

```html
<MDBottomNavigation selectedIndex="1">
<!-- The bottom tab UI is created via TabStrip (the containier) and TabStripItem (for each tab)-->
<MDTabStrip>
<MDTabStripItem>
<Label text="Home"></Label>
<Image src="font://&#xf015;" class="fas"></Image>
</TabStripItem>
<TabStripItem class="special">
<Label text="Account"></Label>
<Image src="font://&#xf007;" class="fas"></Image>
</TabStripItem>
<TabStripItem class="special">
<Label text="Search"></Label>
<Image src="font://&#xf00e;" class="fas"></Image>
</TabStripItem>
</TabStrip>

<!-- The number of TabContentItem components should corespond to the number of TabStripItem components -->
<MDTabContentItem>
<GridLayout>
<Label text="Home Page" class="h2 text-center"></Label>
</GridLayout>
</TabContentItem>
<MDTabContentItem>
<GridLayout>
<Label text="Account Page" class="h2 text-center"></Label>
</GridLayout>
</TabContentItem>
<MDTabContentItem>
<GridLayout>
<Label text="Search Page" class="h2 text-center"></Label>
</GridLayout>
</TabContentItem>
</MDBottomNavigation>
```

## Attributes

| Name |Type| Description|
| ------------- |:-------------:| -----:|
| items | Array<MDTabContentItem> | Gets or sets the items of the BottomNavigation.|
|selectedIndex | number | Gets or sets the selectedIndex of the BottomNavigation.|
|swipeEnabled | boolean | Gets or sets the swipe enabled state of the Tabs.|
|offscreenTabLimit | number | Gets or sets the number of offscreen preloaded tabs of the Tabs.|
|tabStrip |TabStrip | Gets or sets the tab strip of the BottomNavigation.|
|tabsPosition | "top", "bottom" | Gets or sets the position state of the Tabs. Default value: top|
|iOSTabBarItemsAlignment | "leading", "justified", "center", "centerSelected" |iOS Only: Gets or set the MDCTabBarAlignment of the tab bar icons in iOS. Default value: justified|

## Events

|Name | Description|
| ------------- |:-------------:| -----:|
|selectedIndexChanged | Emitted when the selectedIndex property is changed.
|loaded | Emitted when the view is loaded.
|unloaded | Emitted when the view is unloaded.
|layoutChanged | Emitted when the layout bounds of a view changes due to layout processing.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@nativescript-community/ui-material-bottomnavigation",
"name": "@nativescript-community/ui-material-bottom-navigation",
"version": "5.1.16",
"description": "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.",
"main": "bottomnavigation",
Expand All @@ -16,7 +16,7 @@
"tsc-win": "../../node_modules/.bin/cpy ..\\..\\src\\bottom-navigation\\index.d.ts .\\ && ..\\..\\node_modules\\.bin\\tsc --skipLibCheck -d",
"build": "npm run tsc",
"build.all": "npm run build && npm run build.angular",
"build.angular": "../../node_modules/.bin/ng-packagr -p ../../src/bottomnavigation/angular/package.json -c ../../src/bottom-navigation/angular/tsconfig.json",
"build.angular": "../../node_modules/.bin/ng-packagr -p ../../src/bottom-navigation/angular/package.json -c ../../src/bottom-navigation/angular/tsconfig.json",
"clean": "../../node_modules/.bin/rimraf ./*.d.ts ./*.js ./*.js.map"
},
"keywords": [
Expand All @@ -43,7 +43,7 @@
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/nativescript-community/ui-material-components/tree/master/packages/bottomnavigation"
"url": "https://github.com/nativescript-community/ui-material-components/tree/master/packages/bottom-navigation"
},
"readmeFilename": "README.md",
"dependencies": {
Expand Down
File renamed without changes.
Loading

0 comments on commit a508148

Please sign in to comment.