├── app
├── app.component.html
├── fonts
│ ├── FontAwesome.ttf
│ └── fa-regular-400.ttf
├── App_Resources
│ ├── iOS
│ │ ├── Assets.xcassets
│ │ │ ├── Contents.json
│ │ │ ├── AppIcon.appiconset
│ │ │ │ ├── icon-29.png
│ │ │ │ ├── icon-40.png
│ │ │ │ ├── icon-50.png
│ │ │ │ ├── icon-57.png
│ │ │ │ ├── icon-72.png
│ │ │ │ ├── icon-76.png
│ │ │ │ ├── icon-29@2x.png
│ │ │ │ ├── icon-29@3x.png
│ │ │ │ ├── icon-40@2x.png
│ │ │ │ ├── icon-40@3x.png
│ │ │ │ ├── icon-50@2x.png
│ │ │ │ ├── icon-57@2x.png
│ │ │ │ ├── icon-60@2x.png
│ │ │ │ ├── icon-60@3x.png
│ │ │ │ ├── icon-72@2x.png
│ │ │ │ ├── icon-76@2x.png
│ │ │ │ ├── icon-83.5@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── LaunchImage.launchimage
│ │ │ │ ├── Default.png
│ │ │ │ ├── Default@2x.png
│ │ │ │ ├── Default-568h@2x.png
│ │ │ │ ├── Default-667h@2x.png
│ │ │ │ ├── Default-736h@3x.png
│ │ │ │ ├── Default-Landscape.png
│ │ │ │ ├── Default-Portrait.png
│ │ │ │ ├── Default-Landscape@2x.png
│ │ │ │ ├── Default-Landscape@3x.png
│ │ │ │ ├── Default-Portrait@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── LaunchScreen.Center.imageset
│ │ │ │ ├── LaunchScreen-Center.png
│ │ │ │ ├── LaunchScreen-Center@2x.png
│ │ │ │ └── Contents.json
│ │ │ └── LaunchScreen.AspectFill.imageset
│ │ │ │ ├── LaunchScreen-AspectFill.png
│ │ │ │ ├── LaunchScreen-AspectFill@2x.png
│ │ │ │ └── Contents.json
│ │ ├── build.xcconfig
│ │ ├── Info.plist
│ │ └── LaunchScreen.storyboard
│ └── Android
│ │ ├── src
│ │ └── main
│ │ │ ├── res
│ │ │ ├── values-v21
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── drawable-hdpi
│ │ │ │ ├── icon.png
│ │ │ │ ├── logo.png
│ │ │ │ └── background.png
│ │ │ ├── drawable-ldpi
│ │ │ │ ├── icon.png
│ │ │ │ ├── logo.png
│ │ │ │ └── background.png
│ │ │ ├── drawable-mdpi
│ │ │ │ ├── icon.png
│ │ │ │ ├── logo.png
│ │ │ │ └── background.png
│ │ │ ├── drawable-xhdpi
│ │ │ │ ├── icon.png
│ │ │ │ ├── logo.png
│ │ │ │ └── background.png
│ │ │ ├── drawable-xxhdpi
│ │ │ │ ├── icon.png
│ │ │ │ ├── logo.png
│ │ │ │ └── background.png
│ │ │ ├── drawable-xxxhdpi
│ │ │ │ ├── icon.png
│ │ │ │ ├── logo.png
│ │ │ │ └── background.png
│ │ │ ├── values
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ └── drawable-nodpi
│ │ │ │ └── splash_screen.xml
│ │ │ └── AndroidManifest.xml
│ │ └── app.gradle
├── app.component.ts
├── package.json
├── home
│ ├── home.component.css
│ ├── home-routing.module.ts
│ ├── home.module.ts
│ ├── home.component.html
│ └── home.component.ts
├── main.aot.ts
├── main.ts
├── app.css
├── app-routing.module.ts
└── app.module.ts
├── references.d.ts
├── screenshots
└── ns-cradletabbar.gif
├── .gitignore
├── .migration_backup
├── Android-Pre-v4
│ ├── values-v21
│ │ ├── colors.xml
│ │ └── styles.xml
│ ├── drawable-hdpi
│ │ ├── icon.png
│ │ ├── logo.png
│ │ └── background.png
│ ├── drawable-ldpi
│ │ ├── icon.png
│ │ ├── logo.png
│ │ └── background.png
│ ├── drawable-mdpi
│ │ ├── icon.png
│ │ ├── logo.png
│ │ └── background.png
│ ├── drawable-xhdpi
│ │ ├── icon.png
│ │ ├── logo.png
│ │ └── background.png
│ ├── drawable-xxhdpi
│ │ ├── icon.png
│ │ ├── logo.png
│ │ └── background.png
│ ├── drawable-xxxhdpi
│ │ ├── icon.png
│ │ ├── logo.png
│ │ └── background.png
│ ├── values
│ │ ├── colors.xml
│ │ └── styles.xml
│ ├── drawable-nodpi
│ │ └── splash_screen.xml
│ ├── app.gradle
│ └── AndroidManifest.xml
├── tsconfig.tns.json
└── package.json
├── tsconfig.tns.json
├── tsconfig.json
├── README.md
├── package.json
└── webpack.config.js
/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/fonts/FontAwesome.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/fonts/FontAwesome.ttf
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/app/fonts/fa-regular-400.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/fonts/fa-regular-400.ttf
--------------------------------------------------------------------------------
/references.d.ts:
--------------------------------------------------------------------------------
1 | /// Needed for autocompletion and compilation.
--------------------------------------------------------------------------------
/screenshots/ns-cradletabbar.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/screenshots/ns-cradletabbar.gif
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .idea
3 | tmp
4 | node_modules
5 | platforms
6 | report
7 | *.js
8 | !webpack.config.js
9 | *.log
10 | *.keystore
11 |
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/values-v21/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3d5afe
4 |
--------------------------------------------------------------------------------
/tsconfig.tns.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig",
3 | "compilerOptions": {
4 | "module": "es2015",
5 | "moduleResolution": "node"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/values-v21/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3d5afe
4 |
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-hdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-hdpi/logo.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-ldpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-ldpi/logo.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-mdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-mdpi/logo.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-xhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-xhdpi/logo.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-xxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-xxhdpi/logo.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-xxxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-xxxhdpi/logo.png
--------------------------------------------------------------------------------
/.migration_backup/tsconfig.tns.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig",
3 | "compilerOptions": {
4 | "module": "es2015",
5 | "moduleResolution": "node"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-ldpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-ldpi/background.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-mdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-mdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-xhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-xhdpi/background.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-xxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-xxhdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png
--------------------------------------------------------------------------------
/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "ns-app",
5 | templateUrl: "app.component.html"
6 | })
7 | export class AppComponent { }
8 |
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-xxxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/.migration_backup/Android-Pre-v4/drawable-xxxhdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png
--------------------------------------------------------------------------------
/app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "android": {
3 | "v8Flags": "--expose_gc",
4 | "forceLog": true,
5 | "markingMode": "none"
6 | },
7 | "main": "main.js",
8 | "name": "tns-template-blank-ng",
9 | "version": "3.1.1"
10 | }
11 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/williamjuan027/nativescript-cradleTabBar/HEAD/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F5F5F5
4 | #757575
5 | #33B5E5
6 | #272734
7 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F5F5F5
4 | #757575
5 | #33B5E5
6 | #272734
7 |
--------------------------------------------------------------------------------
/app/home/home.component.css:
--------------------------------------------------------------------------------
1 | .home-panel{
2 | vertical-align: center;
3 | font-size: 20;
4 | margin: 15;
5 | }
6 |
7 | .description-label{
8 | margin-bottom: 15;
9 | }
10 |
11 | .fa-regular {
12 | font-family: 'Font Awesome 5 Free', 'fa-regular-400';
13 | font-weight: 400;
14 | }
15 |
--------------------------------------------------------------------------------
/app/main.aot.ts:
--------------------------------------------------------------------------------
1 | // this import should be first in order to load some required settings (like globals and reflect-metadata)
2 | import { platformNativeScript } from "nativescript-angular/platform-static";
3 |
4 | import { AppModuleNgFactory } from "./app.module.ngfactory";
5 |
6 | platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory);
7 |
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/drawable-nodpi/splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 | -
3 |
4 |
5 | -
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/main.ts:
--------------------------------------------------------------------------------
1 | // this import should be first in order to load some required settings (like globals and reflect-metadata)
2 | import { platformNativeScriptDynamic } from "nativescript-angular/platform";
3 | import { enableProdMode } from '@angular/core';
4 |
5 | import { AppModule } from "./app.module";
6 |
7 | enableProdMode();
8 | platformNativeScriptDynamic().bootstrapModule(AppModule);
9 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 | -
3 |
4 |
5 | -
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/app.gradle:
--------------------------------------------------------------------------------
1 | // Add your native dependencies here:
2 |
3 | // Uncomment to add recyclerview-v7 dependency
4 | //dependencies {
5 | // compile 'com.android.support:recyclerview-v7:+'
6 | //}
7 |
8 | android {
9 | defaultConfig {
10 | generatedDensities = []
11 | applicationId = "__PACKAGE__"
12 | }
13 | aaptOptions {
14 | additionalParameters "--no-version-vectors"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/app.gradle:
--------------------------------------------------------------------------------
1 | // Add your native dependencies here:
2 |
3 | // Uncomment to add recyclerview-v7 dependency
4 | //dependencies {
5 | // compile 'com.android.support:recyclerview-v7:+'
6 | //}
7 |
8 | android {
9 | defaultConfig {
10 | generatedDensities = []
11 | applicationId = "org.nativescript.blankng"
12 | }
13 | aaptOptions {
14 | additionalParameters "--no-version-vectors"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/app.css:
--------------------------------------------------------------------------------
1 | /*
2 | In NativeScript, the app.css file is where you place CSS rules that
3 | you would like to apply to your entire application. Check out
4 | http://docs.nativescript.org/ui/styling for a full list of the CSS
5 | selectors and properties you can use to style UI components.
6 |
7 | /*
8 | For example, the following CSS rule changes the font size of all UI
9 | components that have the btn class name.
10 | */
11 | .btn {
12 | font-size: 18;
13 | }
14 |
--------------------------------------------------------------------------------
/app/home/home-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from "@angular/core";
2 | import { Routes } from "@angular/router";
3 | import { NativeScriptRouterModule } from "nativescript-angular/router";
4 |
5 | import { HomeComponent } from "./home.component";
6 |
7 | const routes: Routes = [
8 | { path: "", component: HomeComponent }
9 | ];
10 |
11 | @NgModule({
12 | imports: [NativeScriptRouterModule.forChild(routes)],
13 | exports: [NativeScriptRouterModule]
14 | })
15 | export class HomeRoutingModule { }
16 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-Center.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-Center@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from "@angular/core";
2 | import { Routes } from "@angular/router";
3 | import { NativeScriptRouterModule } from "nativescript-angular/router";
4 |
5 | const routes: Routes = [
6 | { path: "", redirectTo: "/home", pathMatch: "full" },
7 | { path: "home", loadChildren: "./home/home.module#HomeModule" }
8 | ];
9 |
10 | @NgModule({
11 | imports: [NativeScriptRouterModule.forRoot(routes)],
12 | exports: [NativeScriptRouterModule]
13 | })
14 | export class AppRoutingModule { }
15 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-AspectFill.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-AspectFill@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/app/App_Resources/iOS/build.xcconfig:
--------------------------------------------------------------------------------
1 | // You can add custom settings here
2 | // for example you can uncomment the following line to force distribution code signing
3 | // CODE_SIGN_IDENTITY = iPhone Distribution
4 | // To build for device with XCode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID;
6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
7 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
8 |
--------------------------------------------------------------------------------
/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NgModuleFactoryLoader, NO_ERRORS_SCHEMA } from "@angular/core";
2 | import { NativeScriptModule } from "nativescript-angular/nativescript.module";
3 |
4 | import { AppRoutingModule } from "./app-routing.module";
5 | import { AppComponent } from "./app.component";
6 |
7 | @NgModule({
8 | bootstrap: [
9 | AppComponent
10 | ],
11 | imports: [
12 | NativeScriptModule,
13 | AppRoutingModule
14 | ],
15 | declarations: [
16 | AppComponent
17 | ],
18 | schemas: [
19 | NO_ERRORS_SCHEMA
20 | ]
21 | })
22 | export class AppModule { }
23 |
--------------------------------------------------------------------------------
/app/home/home.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
2 | import { NativeScriptCommonModule } from "nativescript-angular/common";
3 | import { NativeScriptFormsModule } from "nativescript-angular/forms";
4 |
5 | import { HomeRoutingModule } from "./home-routing.module";
6 | import { HomeComponent } from "./home.component";
7 |
8 | @NgModule({
9 | imports: [
10 | NativeScriptCommonModule,
11 | HomeRoutingModule,
12 | NativeScriptFormsModule
13 | ],
14 | declarations: [
15 | HomeComponent
16 | ],
17 | schemas: [
18 | NO_ERRORS_SCHEMA
19 | ]
20 | })
21 | export class HomeModule { }
22 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "target": "es5",
5 | "experimentalDecorators": true,
6 | "emitDecoratorMetadata": true,
7 | "noEmitHelpers": true,
8 | "noEmitOnError": true,
9 | "lib": [
10 | "es6",
11 | "dom",
12 | "es2015.iterable"
13 | ],
14 | "baseUrl": ".",
15 | "paths": {
16 | "*": [
17 | "./node_modules/tns-core-modules/*",
18 | "./node_modules/*"
19 | ],
20 | "~/*": [
21 | "app/*"
22 | ]
23 | }
24 | },
25 | "exclude": [
26 | "node_modules",
27 | "platforms",
28 | "typings",
29 | "**/*.aot.ts",
30 | "additional-models"
31 | ]
32 | }
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
14 |
15 |
16 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
14 |
15 |
16 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Nativescript Cradle Tab Bar
2 |
3 | This app is a demonstration on how to create a cradle like animation for bottom tab bars (as featured in [Tabs and BottomNavigation article](https://www.nativescript.org/blog/tabs-and-bottomnavigation-nativescripts-two-new-components) by [Martin Yankov](https://www.nativescript.org/blog/author/martin-yankov)).
4 |
5 | 
6 |
7 | [Link](https://nativescripting.com/posts/cradle-tab-bar-animation-in-nativescript) to Tutorial
8 |
9 | [Link](https://play.nativescript.org/?template=play-ng&id=YfZPr1) to Playground Demo
10 |
11 | ## Development
12 | This app is built with the NativeScript CLI. Once you have the [CLI](https://docs.nativescript.org/start/quick-setup) installed, start by cloning the repo:
13 | ```
14 | git clone https://github.com/williamjuan027/nativescript-cradleTabBar
15 | cd nativescript-cradleTabBar
16 | ```
17 |
18 | From there you can use the `run` command to run the app on iOS:
19 | ```
20 | tns run ios
21 | ```
22 |
23 | And the same command to run the app on Android:
24 | ```
25 | tns run android
26 | ```
27 |
28 | **Note:** Tab bars are set up in the `home` directory inside `home.component.ts` and `home.component.html`
29 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "NativeScript Application",
3 | "license": "SEE LICENSE IN ",
4 | "readme": "NativeScript Application",
5 | "repository": "",
6 | "nativescript": {
7 | "id": "org.nativescript.blankng",
8 | "tns-ios": {
9 | "version": "6.4.2"
10 | },
11 | "tns-android": {
12 | "version": "6.4.1"
13 | }
14 | },
15 | "dependencies": {
16 | "@angular/animations": "8.0.0",
17 | "@angular/common": "8.0.0",
18 | "@angular/compiler": "8.0.0",
19 | "@angular/core": "8.0.0",
20 | "@angular/forms": "8.0.0",
21 | "@angular/http": "~8.0.0-beta.10",
22 | "@angular/platform-browser": "8.0.0",
23 | "@angular/platform-browser-dynamic": "8.0.0",
24 | "@angular/router": "8.0.0",
25 | "nativescript-angular": "8.0.2",
26 | "reflect-metadata": "0.1.13",
27 | "rxjs": "6.5.2",
28 | "rxjs-compat": "6.5.2",
29 | "tns-core-modules": "6.0.1",
30 | "zone.js": "0.9.1"
31 | },
32 | "devDependencies": {
33 | "@angular/compiler-cli": "8.0.0",
34 | "@ngtools/webpack": "~8.0.2",
35 | "nativescript-dev-webpack": "1.0.1",
36 | "tns-platform-declarations": "6.0.1",
37 | "typescript": "3.4.5"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
27 |
28 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
27 |
28 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiresFullScreen
28 |
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/.migration_backup/Android-Pre-v4/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
21 |
22 |
23 |
31 |
32 |
34 |
35 |
36 |
42 |
43 |
45 |
46 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
21 |
22 |
23 |
31 |
32 |
34 |
35 |
36 |
42 |
43 |
45 |
46 |
--------------------------------------------------------------------------------
/.migration_backup/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "NativeScript Application",
3 | "license": "SEE LICENSE IN ",
4 | "readme": "NativeScript Application",
5 | "repository": "",
6 | "nativescript": {
7 | "id": "org.nativescript.blankng",
8 | "tns-android": {
9 | "version": "5.4.0"
10 | },
11 | "tns-ios": {
12 | "version": "5.4.0"
13 | }
14 | },
15 | "dependencies": {
16 | "@angular/animations": "8.0.0",
17 | "@angular/common": "8.0.0",
18 | "@angular/compiler": "8.0.0",
19 | "@angular/core": "8.0.0",
20 | "@angular/forms": "8.0.0",
21 | "@angular/http": "~8.0.0-beta.10",
22 | "@angular/platform-browser": "8.0.0",
23 | "@angular/platform-browser-dynamic": "8.0.0",
24 | "@angular/router": "8.0.0",
25 | "@progress-nativechat/nativescript-nativechat": "2.0.4",
26 | "kinvey-nativescript-sdk": "4.2.0",
27 | "nativescript-accelerometer": "2.0.1",
28 | "nativescript-angular": "8.0.0",
29 | "nativescript-background-http": "3.4.1",
30 | "nativescript-camera": "4.5.0",
31 | "nativescript-image": "2.1.3",
32 | "nativescript-geolocation": "5.1.0",
33 | "nativescript-imagepicker": "6.2.0",
34 | "nativescript-intl": "3.0.0",
35 | "nativescript-iqkeyboardmanager": "1.5.1",
36 | "nativescript-social-share": "1.5.2",
37 | "nativescript-theme-core": "1.0.6",
38 | "nativescript-ui-autocomplete": "4.1.0",
39 | "nativescript-ui-calendar": "4.0.0",
40 | "nativescript-ui-chart": "4.0.2",
41 | "nativescript-ui-dataform": "4.0.1",
42 | "nativescript-ui-gauge": "4.0.0",
43 | "nativescript-ui-listview": "6.3.2",
44 | "nativescript-ui-sidedrawer": "6.0.0",
45 | "reflect-metadata": "0.1.13",
46 | "rxjs": "6.5.2",
47 | "rxjs-compat": "6.5.2",
48 | "tns-core-modules": "5.4.2",
49 | "zone.js": "0.9.1"
50 | },
51 | "devDependencies": {
52 | "@angular/compiler-cli": "8.0.0",
53 | "@ngtools/webpack": "~8.0.2",
54 | "nativescript-dev-typescript": "0.10.0",
55 | "nativescript-dev-webpack": "0.24.1",
56 | "tns-platform-declarations": "5.4.2",
57 | "typescript": "3.4.5"
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "29x29",
5 | "idiom" : "iphone",
6 | "filename" : "icon-29.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "29x29",
11 | "idiom" : "iphone",
12 | "filename" : "icon-29@2x.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "icon-29@3x.png",
19 | "scale" : "3x"
20 | },
21 | {
22 | "size" : "40x40",
23 | "idiom" : "iphone",
24 | "filename" : "icon-40@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "icon-40@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "57x57",
35 | "idiom" : "iphone",
36 | "filename" : "icon-57.png",
37 | "scale" : "1x"
38 | },
39 | {
40 | "size" : "57x57",
41 | "idiom" : "iphone",
42 | "filename" : "icon-57@2x.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "icon-60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "icon-60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "29x29",
59 | "idiom" : "ipad",
60 | "filename" : "icon-29.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "29x29",
65 | "idiom" : "ipad",
66 | "filename" : "icon-29@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "40x40",
71 | "idiom" : "ipad",
72 | "filename" : "icon-40.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "40x40",
77 | "idiom" : "ipad",
78 | "filename" : "icon-40@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "50x50",
83 | "idiom" : "ipad",
84 | "filename" : "icon-50.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "50x50",
89 | "idiom" : "ipad",
90 | "filename" : "icon-50@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "72x72",
95 | "idiom" : "ipad",
96 | "filename" : "icon-72.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "72x72",
101 | "idiom" : "ipad",
102 | "filename" : "icon-72@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "76x76",
107 | "idiom" : "ipad",
108 | "filename" : "icon-76.png",
109 | "scale" : "1x"
110 | },
111 | {
112 | "size" : "76x76",
113 | "idiom" : "ipad",
114 | "filename" : "icon-76@2x.png",
115 | "scale" : "2x"
116 | },
117 | {
118 | "size" : "83.5x83.5",
119 | "idiom" : "ipad",
120 | "filename" : "icon-83.5@2x.png",
121 | "scale" : "2x"
122 | }
123 | ],
124 | "info" : {
125 | "version" : 1,
126 | "author" : "xcode"
127 | }
128 | }
--------------------------------------------------------------------------------
/app/home/home.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "extent" : "full-screen",
5 | "idiom" : "iphone",
6 | "subtype" : "736h",
7 | "filename" : "Default-736h@3x.png",
8 | "minimum-system-version" : "8.0",
9 | "orientation" : "portrait",
10 | "scale" : "3x"
11 | },
12 | {
13 | "extent" : "full-screen",
14 | "idiom" : "iphone",
15 | "subtype" : "736h",
16 | "filename" : "Default-Landscape@3x.png",
17 | "minimum-system-version" : "8.0",
18 | "orientation" : "landscape",
19 | "scale" : "3x"
20 | },
21 | {
22 | "extent" : "full-screen",
23 | "idiom" : "iphone",
24 | "subtype" : "667h",
25 | "filename" : "Default-667h@2x.png",
26 | "minimum-system-version" : "8.0",
27 | "orientation" : "portrait",
28 | "scale" : "2x"
29 | },
30 | {
31 | "orientation" : "portrait",
32 | "idiom" : "iphone",
33 | "filename" : "Default@2x.png",
34 | "extent" : "full-screen",
35 | "minimum-system-version" : "7.0",
36 | "scale" : "2x"
37 | },
38 | {
39 | "extent" : "full-screen",
40 | "idiom" : "iphone",
41 | "subtype" : "retina4",
42 | "filename" : "Default-568h@2x.png",
43 | "minimum-system-version" : "7.0",
44 | "orientation" : "portrait",
45 | "scale" : "2x"
46 | },
47 | {
48 | "orientation" : "portrait",
49 | "idiom" : "ipad",
50 | "filename" : "Default-Portrait.png",
51 | "extent" : "full-screen",
52 | "minimum-system-version" : "7.0",
53 | "scale" : "1x"
54 | },
55 | {
56 | "orientation" : "landscape",
57 | "idiom" : "ipad",
58 | "filename" : "Default-Landscape.png",
59 | "extent" : "full-screen",
60 | "minimum-system-version" : "7.0",
61 | "scale" : "1x"
62 | },
63 | {
64 | "orientation" : "portrait",
65 | "idiom" : "ipad",
66 | "filename" : "Default-Portrait@2x.png",
67 | "extent" : "full-screen",
68 | "minimum-system-version" : "7.0",
69 | "scale" : "2x"
70 | },
71 | {
72 | "orientation" : "landscape",
73 | "idiom" : "ipad",
74 | "filename" : "Default-Landscape@2x.png",
75 | "extent" : "full-screen",
76 | "minimum-system-version" : "7.0",
77 | "scale" : "2x"
78 | },
79 | {
80 | "orientation" : "portrait",
81 | "idiom" : "iphone",
82 | "filename" : "Default.png",
83 | "extent" : "full-screen",
84 | "scale" : "1x"
85 | },
86 | {
87 | "orientation" : "portrait",
88 | "idiom" : "iphone",
89 | "filename" : "Default@2x.png",
90 | "extent" : "full-screen",
91 | "scale" : "2x"
92 | },
93 | {
94 | "orientation" : "portrait",
95 | "idiom" : "iphone",
96 | "filename" : "Default-568h@2x.png",
97 | "extent" : "full-screen",
98 | "subtype" : "retina4",
99 | "scale" : "2x"
100 | },
101 | {
102 | "orientation" : "portrait",
103 | "idiom" : "ipad",
104 | "extent" : "to-status-bar",
105 | "scale" : "1x"
106 | },
107 | {
108 | "orientation" : "portrait",
109 | "idiom" : "ipad",
110 | "filename" : "Default-Portrait.png",
111 | "extent" : "full-screen",
112 | "scale" : "1x"
113 | },
114 | {
115 | "orientation" : "landscape",
116 | "idiom" : "ipad",
117 | "extent" : "to-status-bar",
118 | "scale" : "1x"
119 | },
120 | {
121 | "orientation" : "landscape",
122 | "idiom" : "ipad",
123 | "filename" : "Default-Landscape.png",
124 | "extent" : "full-screen",
125 | "scale" : "1x"
126 | },
127 | {
128 | "orientation" : "portrait",
129 | "idiom" : "ipad",
130 | "extent" : "to-status-bar",
131 | "scale" : "2x"
132 | },
133 | {
134 | "orientation" : "portrait",
135 | "idiom" : "ipad",
136 | "filename" : "Default-Portrait@2x.png",
137 | "extent" : "full-screen",
138 | "scale" : "2x"
139 | },
140 | {
141 | "orientation" : "landscape",
142 | "idiom" : "ipad",
143 | "extent" : "to-status-bar",
144 | "scale" : "2x"
145 | },
146 | {
147 | "orientation" : "landscape",
148 | "idiom" : "ipad",
149 | "filename" : "Default-Landscape@2x.png",
150 | "extent" : "full-screen",
151 | "scale" : "2x"
152 | }
153 | ],
154 | "info" : {
155 | "version" : 1,
156 | "author" : "xcode"
157 | }
158 | }
--------------------------------------------------------------------------------
/app/home/home.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, ViewChild, ElementRef, ViewChildren, QueryList } from "@angular/core";
2 | import { isAndroid, screen } from "tns-core-modules/platform";
3 | import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout";
4 | import { PanGestureEventData, GestureStateTypes, GestureEventData } from "tns-core-modules/ui/gestures";
5 | import { AnimationCurve } from "tns-core-modules/ui/enums";
6 | import { SelectedIndexChangedEventData } from "tns-core-modules/ui/tab-view";
7 |
8 | @Component({
9 | selector: "Home",
10 | moduleId: module.id,
11 | templateUrl: "./home.component.html",
12 | styleUrls: ["./home.component.css"]
13 | })
14 | export class HomeComponent {
15 |
16 | @ViewChild('tabs', { static: true }) tabs: ElementRef;
17 | @ViewChild('centerCircle', { static: true }) centerCircle: ElementRef;
18 | @ViewChild('dragCircle', { static: true }) dragCircle: ElementRef;
19 | @ViewChild('leftTabs', { static: true }) leftTabs: ElementRef;
20 | @ViewChild('rightTabs', { static: true }) rightTabs: ElementRef;
21 | @ViewChild('centerPatch', { static: true }) centerPatch: ElementRef;
22 | @ViewChild('tabBGContainer', { static: true }) tabBGContainer: ElementRef;
23 |
24 | @ViewChildren('tabContents', { read: ElementRef }) tabContents: QueryList;
25 |
26 | // Tab Contents and Properties
27 | defaultSelected: number = 2;
28 | tabContainer = {
29 | backgroundColor: '#fff',
30 | focusColor: '#fff'
31 | };
32 | tabList: { text: string, icon?: string, color?: string, backgroundColor: string, fadeColor?: string }[] = [
33 | { text: String.fromCharCode(0xf080), backgroundColor: '#5B37B7', color: '#000' },
34 | { text: String.fromCharCode(0xf075), backgroundColor: '#E6A938', color: '#000' },
35 | { text: String.fromCharCode(0xf259), backgroundColor: '#C9449D', color: '#000' },
36 | { text: String.fromCharCode(0xf1d8), backgroundColor: '#4195AA', color: '#000' },
37 | { text: String.fromCharCode(0xf073), backgroundColor: '#4A9F6E', color: '#000' }
38 | ];
39 |
40 |
41 | // Tab Helper
42 | isAndroid = isAndroid;
43 | private prevDeltaX: number = 0;
44 | private animationCurve = AnimationCurve.cubicBezier(.38, .47, 0, 1);
45 | private androidTargetTabIndex: number = this.defaultSelected;
46 |
47 | constructor() { }
48 |
49 | // --------------------------------------------------------------------
50 | // User Interaction
51 |
52 | onSelectedIndexChanged(args: SelectedIndexChangedEventData): void {
53 | if (isAndroid && args.newIndex !== this.androidTargetTabIndex) {
54 | // NOTE: this is a workaround for android firing this event multiple times,
55 | // and stopping on the wrong tab
56 | // TODO: fix this
57 | setTimeout(() => {
58 | this.tabs.nativeElement.selectedIndex = this.androidTargetTabIndex;
59 | })
60 | }
61 | // TODO: unocmment this if swipeEnabled
62 | // Figure out a way to differentiate between selected index is fired
63 | // from swipe event or from setting index programmatically
64 | // if (args.newIndex !== this.currentTabIndex) {
65 | // this.onBottomNavTap(args.newIndex);
66 | // }
67 | }
68 |
69 | // Tap on a one of the tabs
70 | onBottomNavTap(index: number, duration: number = 300): void {
71 | if (index < 0) {
72 | return;
73 | }
74 | const currentIndex = this.tabs.nativeElement.selectedIndex;
75 | if (currentIndex !== index) {
76 | const tabContentsArr = this.tabContents.toArray();
77 |
78 | // set unfocus to previous index
79 | tabContentsArr[currentIndex].nativeElement.animate(this.getUnfocusAnimation(currentIndex, duration)).catch(e => { });
80 |
81 | // set focus to current index
82 | tabContentsArr[index].nativeElement.animate(this.getFocusAnimation(index, duration)).catch(e => { });
83 |
84 | // set current index to new index
85 | this.androidTargetTabIndex = index;
86 | this.tabs.nativeElement.selectedIndex = index;
87 | }
88 | this.centerCircle.nativeElement.backgroundColor = this.tabList[index].backgroundColor;
89 | this.centerCircle.nativeElement.animate(this.getSlideAnimation(index, duration)).catch(e => { });
90 | this.leftTabs.nativeElement.animate(this.getSlideAnimation(index, duration)).catch(e => { });
91 | this.rightTabs.nativeElement.animate(this.getSlideAnimation(index, duration)).catch(e => { });
92 | this.centerPatch.nativeElement.animate(this.getSlideAnimation(index, duration)).catch(e => { });
93 | this.dragCircle.nativeElement.animate(this.getSlideAnimation(index, duration)).catch(e => { });
94 | }
95 |
96 | // Drag the focus circle to one of the tabs
97 | onCenterCirclePan(args: PanGestureEventData): void {
98 | let grdLayout: GridLayout = args.object;
99 | let newX: number = grdLayout.translateX + args.deltaX - this.prevDeltaX;
100 |
101 | if (args.state === 0) {
102 | // finger down
103 | this.prevDeltaX = 0;
104 | } else if (args.state === 2) {
105 | // finger moving
106 | grdLayout.translateX = newX;
107 | this.leftTabs.nativeElement.translateX = newX;
108 | this.rightTabs.nativeElement.translateX = newX;
109 | this.centerPatch.nativeElement.translateX = newX;
110 | this.centerCircle.nativeElement.translateX = newX;
111 |
112 | this.prevDeltaX = args.deltaX;
113 | } else if (args.state === 3) {
114 | // finger up
115 | this.prevDeltaX = 0;
116 | const tabWidth = screen.mainScreen.widthDIPs / this.tabList.length;
117 | const tabSelected: number = Math.round(Math.abs(newX / tabWidth));
118 | const translateX: number = tabSelected * tabWidth;
119 | if (newX < 0) {
120 | // pan left
121 | this.onBottomNavTap(this.defaultSelected - tabSelected, 50);
122 | } else {
123 | // pan right
124 | this.onBottomNavTap(this.defaultSelected + tabSelected, 50);
125 | }
126 | }
127 | }
128 |
129 | // --------------------------------------------------------------------
130 | // Tab bar helpers
131 |
132 | onTabsLoaded(args): void {
133 | if (args.object.ios) {
134 | args.object.ios.tabBar.hidden = true;
135 | }
136 | }
137 |
138 | ontabContentsLoaded(args): void {
139 | // set up base layer
140 | this.leftTabs.nativeElement.width = screen.mainScreen.widthDIPs;
141 | this.rightTabs.nativeElement.width = screen.mainScreen.widthDIPs;
142 | this.centerPatch.nativeElement.width = 100;
143 |
144 | this.tabBGContainer.nativeElement.translateX = - (screen.mainScreen.widthDIPs / 2) - (80 / 2);
145 |
146 | // set default selected tab
147 | this.centerCircle.nativeElement.backgroundColor = this.tabList[this.defaultSelected].backgroundColor;
148 | const tabContentsArr = this.tabContents.toArray();
149 | tabContentsArr[this.defaultSelected].nativeElement.scaleX = 1.5;
150 | tabContentsArr[this.defaultSelected].nativeElement.scaleY = 1.5;
151 | tabContentsArr[this.defaultSelected].nativeElement.translateY = - 15;
152 | this.tabs.nativeElement.selectedIndex = this.defaultSelected;
153 | }
154 |
155 | getSlideAnimation(index: number, duration: number) {
156 | return {
157 | translate: { x: this.getTabTranslateX(index), y: 0 },
158 | curve: this.animationCurve,
159 | duration: duration
160 | };
161 | }
162 |
163 | getFocusAnimation(index: number, duration: number) {
164 | return {
165 | scale: { x: 1.5, y: 1.5 },
166 | translate: { x: 0, y: -15 },
167 | duration: duration
168 | };
169 | }
170 |
171 | getUnfocusAnimation(index: number, duration: number) {
172 | return {
173 | scale: { x: 1, y: 1 },
174 | translate: { x: 0, y: 0 },
175 | duration: duration
176 | };
177 | }
178 |
179 | getTabTranslateX(index: number): number {
180 | return index * screen.mainScreen.widthDIPs / this.tabList.length - (screen.mainScreen.widthDIPs / 2) + (80 / 2);
181 | }
182 | }
183 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const { join, relative, resolve, sep, dirname } = require("path");
2 |
3 | const webpack = require("webpack");
4 | const nsWebpack = require("nativescript-dev-webpack");
5 | const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target");
6 | const { nsReplaceBootstrap } = require("nativescript-dev-webpack/transformers/ns-replace-bootstrap");
7 | const { nsReplaceLazyLoader } = require("nativescript-dev-webpack/transformers/ns-replace-lazy-loader");
8 | const { nsSupportHmrNg } = require("nativescript-dev-webpack/transformers/ns-support-hmr-ng");
9 | const { getMainModulePath } = require("nativescript-dev-webpack/utils/ast-utils");
10 | const CleanWebpackPlugin = require("clean-webpack-plugin");
11 | const CopyWebpackPlugin = require("copy-webpack-plugin");
12 | const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
13 | const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
14 | const TerserPlugin = require("terser-webpack-plugin");
15 | const { getAngularCompilerPlugin } = require("nativescript-dev-webpack/plugins/NativeScriptAngularCompilerPlugin");
16 | const hashSalt = Date.now().toString();
17 |
18 | module.exports = env => {
19 | // Add your custom Activities, Services and other Android app components here.
20 | const appComponents = [
21 | "tns-core-modules/ui/frame",
22 | "tns-core-modules/ui/frame/activity",
23 | ];
24 |
25 | const platform = env && (env.android && "android" || env.ios && "ios");
26 | if (!platform) {
27 | throw new Error("You need to provide a target platform!");
28 | }
29 |
30 | const AngularCompilerPlugin = getAngularCompilerPlugin(platform);
31 | const projectRoot = __dirname;
32 |
33 | // Default destination inside platforms//...
34 | const dist = resolve(projectRoot, nsWebpack.getAppPath(platform, projectRoot));
35 |
36 | const {
37 | // The 'appPath' and 'appResourcesPath' values are fetched from
38 | // the nsconfig.json configuration file
39 | // when bundling with `tns run android|ios --bundle`.
40 | appPath = "src",
41 | appResourcesPath = "App_Resources",
42 |
43 | // You can provide the following flags when running 'tns run android|ios'
44 | aot, // --env.aot
45 | snapshot, // --env.snapshot,
46 | production, // --env.production
47 | uglify, // --env.uglify
48 | report, // --env.report
49 | sourceMap, // --env.sourceMap
50 | hiddenSourceMap, // --env.hiddenSourceMap
51 | hmr, // --env.hmr,
52 | unitTesting, // --env.unitTesting
53 | verbose, // --env.verbose
54 | } = env;
55 |
56 | const isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;
57 | const externals = nsWebpack.getConvertedExternals(env.externals);
58 | const appFullPath = resolve(projectRoot, appPath);
59 | const appResourcesFullPath = resolve(projectRoot, appResourcesPath);
60 | const tsConfigName = "tsconfig.tns.json";
61 | const entryModule = `${nsWebpack.getEntryModule(appFullPath, platform)}.ts`;
62 | const entryPath = `.${sep}${entryModule}`;
63 | const entries = { bundle: entryPath };
64 | const areCoreModulesExternal = Array.isArray(env.externals) && env.externals.some(e => e.indexOf("tns-core-modules") > -1);
65 | if (platform === "ios" && !areCoreModulesExternal) {
66 | entries["tns_modules/tns-core-modules/inspector_modules"] = "inspector_modules";
67 | };
68 |
69 | const ngCompilerTransformers = [];
70 | const additionalLazyModuleResources = [];
71 | if (aot) {
72 | ngCompilerTransformers.push(nsReplaceBootstrap);
73 | }
74 |
75 | if (hmr) {
76 | ngCompilerTransformers.push(nsSupportHmrNg);
77 | }
78 |
79 | // when "@angular/core" is external, it's not included in the bundles. In this way, it will be used
80 | // directly from node_modules and the Angular modules loader won't be able to resolve the lazy routes
81 | // fixes https://github.com/NativeScript/nativescript-cli/issues/4024
82 | if (env.externals && env.externals.indexOf("@angular/core") > -1) {
83 | const appModuleRelativePath = getMainModulePath(resolve(appFullPath, entryModule), tsConfigName);
84 | if (appModuleRelativePath) {
85 | const appModuleFolderPath = dirname(resolve(appFullPath, appModuleRelativePath));
86 | // include the lazy loader inside app module
87 | ngCompilerTransformers.push(nsReplaceLazyLoader);
88 | // include the new lazy loader path in the allowed ones
89 | additionalLazyModuleResources.push(appModuleFolderPath);
90 | }
91 | }
92 |
93 | const ngCompilerPlugin = new AngularCompilerPlugin({
94 | hostReplacementPaths: nsWebpack.getResolver([platform, "tns"]),
95 | platformTransformers: ngCompilerTransformers.map(t => t(() => ngCompilerPlugin, resolve(appFullPath, entryModule), projectRoot)),
96 | mainPath: join(appFullPath, entryModule),
97 | tsConfigPath: join(__dirname, tsConfigName),
98 | skipCodeGeneration: !aot,
99 | sourceMap: !!isAnySourceMapEnabled,
100 | additionalLazyModuleResources: additionalLazyModuleResources
101 | });
102 |
103 | let sourceMapFilename = nsWebpack.getSourceMapFilename(hiddenSourceMap, __dirname, dist);
104 |
105 | const itemsToClean = [`${dist}/**/*`];
106 | if (platform === "android") {
107 | itemsToClean.push(`${join(projectRoot, "platforms", "android", "app", "src", "main", "assets", "snapshots")}`);
108 | itemsToClean.push(`${join(projectRoot, "platforms", "android", "app", "build", "configurations", "nativescript-android-snapshot")}`);
109 | }
110 |
111 | nsWebpack.processAppComponents(appComponents, platform);
112 | const config = {
113 | mode: production ? "production" : "development",
114 | context: appFullPath,
115 | externals,
116 | watchOptions: {
117 | ignored: [
118 | appResourcesFullPath,
119 | // Don't watch hidden files
120 | "**/.*",
121 | ]
122 | },
123 | target: nativescriptTarget,
124 | entry: entries,
125 | output: {
126 | pathinfo: false,
127 | path: dist,
128 | sourceMapFilename,
129 | libraryTarget: "commonjs2",
130 | filename: "[name].js",
131 | globalObject: "global",
132 | hashSalt
133 | },
134 | resolve: {
135 | extensions: [".ts", ".js", ".scss", ".css"],
136 | // Resolve {N} system modules from tns-core-modules
137 | modules: [
138 | resolve(__dirname, "node_modules/tns-core-modules"),
139 | resolve(__dirname, "node_modules"),
140 | "node_modules/tns-core-modules",
141 | "node_modules",
142 | ],
143 | alias: {
144 | '~': appFullPath
145 | },
146 | symlinks: true
147 | },
148 | resolveLoader: {
149 | symlinks: false
150 | },
151 | node: {
152 | // Disable node shims that conflict with NativeScript
153 | "http": false,
154 | "timers": false,
155 | "setImmediate": false,
156 | "fs": "empty",
157 | "__dirname": false,
158 | },
159 | devtool: hiddenSourceMap ? "hidden-source-map" : (sourceMap ? "inline-source-map" : "none"),
160 | optimization: {
161 | runtimeChunk: "single",
162 | splitChunks: {
163 | cacheGroups: {
164 | vendor: {
165 | name: "vendor",
166 | chunks: "all",
167 | test: (module, chunks) => {
168 | const moduleName = module.nameForCondition ? module.nameForCondition() : '';
169 | return /[\\/]node_modules[\\/]/.test(moduleName) ||
170 | appComponents.some(comp => comp === moduleName);
171 | },
172 | enforce: true,
173 | },
174 | }
175 | },
176 | minimize: !!uglify,
177 | minimizer: [
178 | new TerserPlugin({
179 | parallel: true,
180 | cache: true,
181 | sourceMap: isAnySourceMapEnabled,
182 | terserOptions: {
183 | output: {
184 | comments: false,
185 | semicolons: !isAnySourceMapEnabled
186 | },
187 | compress: {
188 | // The Android SBG has problems parsing the output
189 | // when these options are enabled
190 | 'collapse_vars': platform !== "android",
191 | sequences: platform !== "android",
192 | }
193 | }
194 | })
195 | ],
196 | },
197 | module: {
198 | rules: [
199 | {
200 | test: nsWebpack.getEntryPathRegExp(appFullPath, entryPath),
201 | use: [
202 | // Require all Android app components
203 | platform === "android" && {
204 | loader: "nativescript-dev-webpack/android-app-components-loader",
205 | options: { modules: appComponents }
206 | },
207 |
208 | {
209 | loader: "nativescript-dev-webpack/bundle-config-loader",
210 | options: {
211 | angular: true,
212 | loadCss: !snapshot, // load the application css if in debug mode
213 | unitTesting,
214 | appFullPath,
215 | projectRoot,
216 | ignoredFiles: nsWebpack.getUserDefinedEntries(entries, platform)
217 | }
218 | },
219 | ].filter(loader => !!loader)
220 | },
221 |
222 | { test: /\.html$|\.xml$/, use: "raw-loader" },
223 |
224 | // tns-core-modules reads the app.css and its imports using css-loader
225 | {
226 | test: /[\/|\\]app\.css$/,
227 | use: [
228 | "nativescript-dev-webpack/style-hot-loader",
229 | { loader: "css-loader", options: { url: false } }
230 | ]
231 | },
232 | {
233 | test: /[\/|\\]app\.scss$/,
234 | use: [
235 | "nativescript-dev-webpack/style-hot-loader",
236 | { loader: "css-loader", options: { url: false } },
237 | "sass-loader"
238 | ]
239 | },
240 |
241 | // Angular components reference css files and their imports using raw-loader
242 | { test: /\.css$/, exclude: /[\/|\\]app\.css$/, use: "raw-loader" },
243 | { test: /\.scss$/, exclude: /[\/|\\]app\.scss$/, use: ["raw-loader", "resolve-url-loader", "sass-loader"] },
244 |
245 | {
246 | test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/,
247 | use: [
248 | "nativescript-dev-webpack/moduleid-compat-loader",
249 | "nativescript-dev-webpack/lazy-ngmodule-hot-loader",
250 | "@ngtools/webpack",
251 | ]
252 | },
253 |
254 | // Mark files inside `@angular/core` as using SystemJS style dynamic imports.
255 | // Removing this will cause deprecation warnings to appear.
256 | {
257 | test: /[\/\\]@angular[\/\\]core[\/\\].+\.js$/,
258 | parser: { system: true },
259 | },
260 | ],
261 | },
262 | plugins: [
263 | // Define useful constants like TNS_WEBPACK
264 | new webpack.DefinePlugin({
265 | "global.TNS_WEBPACK": "true",
266 | "process": "global.process",
267 | }),
268 | // Remove all files from the out dir.
269 | new CleanWebpackPlugin(itemsToClean, { verbose: !!verbose }),
270 | // Copy assets to out dir. Add your own globs as needed.
271 | new CopyWebpackPlugin([
272 | { from: { glob: "fonts/**" } },
273 | { from: { glob: "**/*.jpg" } },
274 | { from: { glob: "**/*.png" } },
275 | ], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
276 | new nsWebpack.GenerateNativeScriptEntryPointsPlugin("bundle"),
277 | // For instructions on how to set up workers with webpack
278 | // check out https://github.com/nativescript/worker-loader
279 | new NativeScriptWorkerPlugin(),
280 | ngCompilerPlugin,
281 | // Does IPC communication with the {N} CLI to notify events when running in watch mode.
282 | new nsWebpack.WatchStateLoggerPlugin(),
283 | ],
284 | };
285 |
286 | if (report) {
287 | // Generate report files for bundles content
288 | config.plugins.push(new BundleAnalyzerPlugin({
289 | analyzerMode: "static",
290 | openAnalyzer: false,
291 | generateStatsFile: true,
292 | reportFilename: resolve(projectRoot, "report", `report.html`),
293 | statsFilename: resolve(projectRoot, "report", `stats.json`),
294 | }));
295 | }
296 |
297 | if (snapshot) {
298 | config.plugins.push(new nsWebpack.NativeScriptSnapshotPlugin({
299 | chunk: "vendor",
300 | angular: true,
301 | requireModules: [
302 | "reflect-metadata",
303 | "@angular/platform-browser",
304 | "@angular/core",
305 | "@angular/common",
306 | "@angular/router",
307 | "nativescript-angular/platform-static",
308 | "nativescript-angular/router",
309 | ],
310 | projectRoot,
311 | webpackConfig: config,
312 | }));
313 | }
314 |
315 | if (hmr) {
316 | config.plugins.push(new webpack.HotModuleReplacementPlugin());
317 | }
318 |
319 | return config;
320 | };
321 |
--------------------------------------------------------------------------------