test(e2e): add modal-navigation app (#5393)

* chore(apps): add modal-navigation-app for ui testing

* test(e2e): add modal-navigation app

* test(apps): remove modal-navigation-app

The app has been moved to `e2e/modal-navigation`.

* chore: include e2e folder to npm scripts

* docs: include e2e folder to DevelopmentWorkflow.md

* chore(e2e): update .gitignore

* fix(e2e): relative paths

* chore(e2e): update package.json

* test(e2e): add change root view to modal-navigation

* test(e2e): set androidTabsPosition to botton

* chore(e2e): add VSCode launch.json config

* docs(e2e): delete LICENSE and README.md files

* refactor(e2e): rename modal-tab-page to modal-tab-root

* test(e2e): update iOS launch screen
This commit is contained in:
Manol Donev
2018-02-14 16:51:51 +02:00
committed by Vasil Chimev
parent 2edef3de3b
commit e1eea8efe7
86 changed files with 1083 additions and 8 deletions

2
.gitignore vendored
View File

@@ -51,6 +51,8 @@ apps/lib/
apps/hooks/
apps/node_modules/
e2e/**/platforms
package-lock.json
.nsbuildinfo

View File

@@ -6,6 +6,7 @@ Development Workflow
The repository contains several packages and apps:
- `tns-core-modules` - The core NativeScript TypeScript modules used to develop NativeScript apps.
- `apps` - UI app used for manual testing and automation.
- `e2e` - applications and *e2e* tests.
- `tests` - Unit tests app for the `tns-core-modules`.
- `tns-platform-declarations` - TypeScript definitions for Android and iOS native APIs.
@@ -18,6 +19,9 @@ Managing dependencies:
- `apps` depends on:
- `tns-platform-declarations`
- `tns-core-modules`
- `e2e` depends on:
- `tns-platform-declarations`
- `tns-core-modules`
- `tests` depends on:
- `tns-platform-declarations`
- `tns-core-modules`
@@ -26,22 +30,27 @@ Managing dependencies:
this dependency contains native code and is rarely modified so for now it remains outside this repo.
## Initial Setup
Clone (or fork/clone) the repo:
```bash
git clone https://github.com/NativeScript/NativeScript.git
```
Install devDependencies:
```bash
npm install
```
Run setup script. This will [`npm link`](https://docs.npmjs.com/cli/link) the `tns-core-modules` and `tns-core-modules-declarations` dependencies inside the `tests` and `apps` projects.
Run `setup` script. This will [`npm link`](https://docs.npmjs.com/cli/link) the `tns-core-modules` and `tns-core-modules-declarations` dependencies inside the `tests`, `apps` and `e2e` projects.
```bash
npm run setup
```
## TypeScript
The following commands are commonly used to compile the `tns-core-modules`:
```bash
# Full tsc with type checking ~22.2s.
@@ -55,18 +64,22 @@ tsc --skipLibCheck -w
```
The modules have `typescript` as a devDependency so you should also be able to use the locally installed TypeScript compiler from node_modules:
```bash
./node_modules/.bin/tsc
```
You can compile the TypeScript files in the `tns-core-modules`, `tns-platform-declarations`, `apps` and `tests` at once at the root of the repo:
You can compile the TypeScript files in the `tns-core-modules`, `tns-platform-declarations`, `apps`, `e2e` and `tests` at once at the root of the repo:
```bash
npm run tsc
```
## Running Unit Tests
The test app is an ordinary NativeScript app that logs the test results as it go.
After the [initial setup](#initial-setup) you can run the tests with:
```bash
# Make sure TypeScript is transpiled
tsc
@@ -91,6 +104,7 @@ tns run android --path apps
```
## Running Another App
The [initial setup](#initial-setup) will `npm-link` the `tns-core-modules` globally. You can use it in any local project:
```bash
@@ -101,25 +115,33 @@ npm link tns-core-modules
tns run ios
tns run android
```
>Note: You still have to rebuild the TypeScript if you have made changes in the code of the core-modules.
> Note: You still have to rebuild the TypeScript if you have made changes in the code of the core-modules.
## Platform declarations
To update the platform declarations (the ios.d.ts-es) you can run:
```
npm install
npm run dev-declarations
```
This script will update the iOS declarations. Android tools are not integrated yet.
The declarations are generated from the test app and will include the native code from tns-core-modules-widgets.
# Documentation API reference
The following will build the API reference pages in `bin/dist/apiref`:
```
npm run typedoc
```
If you want to improve on the documentation you can also build and start up dev web server:
```
npm run dev-typedoc
```
The terminal will point the address you can open in your web browsed.

View File

@@ -6,10 +6,10 @@
"nativescript": {
"id": "org.nativescript.apps",
"tns-ios": {
"version": "3.2.0"
"version": "3.4.1"
},
"tns-android": {
"version": "3.2.0"
"version": "3.4.1"
}
},
"dependencies": {

View File

@@ -0,0 +1,61 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch on iOS",
"type": "nativescript",
"request": "launch",
"platform": "ios",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"stopOnEntry": true,
"tnsArgs": [
"--syncAllFiles"
],
"watch": true
},
{
"name": "Attach on iOS",
"type": "nativescript",
"request": "attach",
"platform": "ios",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"stopOnEntry": true,
"tnsArgs": [
"--syncAllFiles"
],
"watch": false
},
{
"name": "Launch on Android",
"type": "nativescript",
"request": "launch",
"platform": "android",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"stopOnEntry": true,
"tnsArgs": [
"--syncAllFiles"
],
"watch": true
},
{
"name": "Attach on Android",
"type": "nativescript",
"request": "attach",
"platform": "android",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"stopOnEntry": true,
"tnsArgs": [
"--syncAllFiles"
],
"watch": false
}
]
}

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="__PACKAGE__"
android:versionCode="1"
android:versionName="1.0">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"/>
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="__APILEVEL__"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:name="com.tns.NativeScriptApplication"
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name="com.tns.NativeScriptActivity"
android:label="@string/title_activity_kimera"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@style/LaunchScreenTheme">
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.tns.ErrorReportActivity"/>
</application>
</manifest>

View File

@@ -0,0 +1,16 @@
// Add your native dependencies here:
// Uncomment to add recyclerview-v7 dependency
//dependencies {
// compile 'com.android.support:recyclerview-v7:+'
//}
android {
defaultConfig {
generatedDensities = []
applicationId = "org.nativescript.modalnavigation"
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
}

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,8 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="fill">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background" />
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/logo" />
</item>
</layer-list>

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ns_accent">#3d5afe</color>
</resources>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Application theme -->
<style name="AppTheme" parent="AppThemeBase">
<item name="android:datePickerStyle">@style/SpinnerDatePicker</item>
<item name="android:timePickerStyle">@style/SpinnerTimePicker</item>
</style>
<!-- Default style for DatePicker - in spinner mode -->
<style name="SpinnerDatePicker" parent="android:Widget.Material.Light.DatePicker">
<item name="android:datePickerMode">spinner</item>
</style>
<!-- Default style for TimePicker - in spinner mode -->
<style name="SpinnerTimePicker" parent="android:Widget.Material.Light.TimePicker">
<item name="android:timePickerMode">spinner</item>
</style>
<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
<item name="android:elevation">4dp</item>
</style>
</resources>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ns_primary">#F5F5F5</color>
<color name="ns_primaryDark">#757575</color>
<color name="ns_accent">#33B5E5</color>
<color name="ns_blue">#272734</color>
</resources>

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- theme to use FOR launch screen-->
<style name="LaunchScreenThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
<item name="colorPrimary">@color/ns_primary</item>
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
<item name="colorAccent">@color/ns_accent</item>
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowTranslucentStatus">true</item>
</style>
<style name="LaunchScreenTheme" parent="LaunchScreenThemeBase">
</style>
<!-- theme to use AFTER launch screen is loaded-->
<style name="AppThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
<item name="colorPrimary">@color/ns_primary</item>
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
<item name="colorAccent">@color/ns_accent</item>
</style>
<style name="AppTheme" parent="AppThemeBase">
</style>
<!-- theme for action-bar -->
<style name="NativeScriptToolbarStyleBase" parent="Widget.AppCompat.Toolbar">
<item name="android:background">@color/ns_primary</item>
<item name="theme">@style/ThemeOverlay.AppCompat.ActionBar</item>
<item name="popupTheme">@style/ThemeOverlay.AppCompat</item>
</style>
<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
</style>
</resources>

View File

@@ -0,0 +1,98 @@
{
"images" : [
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon-29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon-29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon-29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "icon-40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "icon-40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "icon-60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "icon-60@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "icon-29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "icon-29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "icon-40.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "icon-40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "icon-76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "icon-76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "icon-83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "icon-1024.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@@ -0,0 +1,176 @@
{
"images" : [
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "2436h",
"filename" : "Default-1125h.png",
"minimum-system-version" : "11.0",
"orientation" : "portrait",
"scale" : "3x"
},
{
"orientation" : "landscape",
"idiom" : "iphone",
"extent" : "full-screen",
"filename" : "Default-Landscape-X.png",
"minimum-system-version" : "11.0",
"subtype" : "2436h",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "Default-736h@3x.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "Default-Landscape@3x.png",
"minimum-system-version" : "8.0",
"orientation" : "landscape",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "667h",
"filename" : "Default-667h@2x.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "Default@2x.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "retina4",
"filename" : "Default-568h@2x.png",
"minimum-system-version" : "7.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"filename" : "Default-Portrait.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"filename" : "Default-Landscape.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"filename" : "Default-Portrait@2x.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"filename" : "Default-Landscape@2x.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "Default.png",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "Default@2x.png",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "Default-568h@2x.png",
"extent" : "full-screen",
"subtype" : "retina4",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "to-status-bar",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"filename" : "Default-Portrait.png",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "to-status-bar",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"filename" : "Default-Landscape.png",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "to-status-bar",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"filename" : "Default-Portrait@2x.png",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "to-status-bar",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"filename" : "Default-Landscape@2x.png",
"extent" : "full-screen",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchScreen-AspectFill.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchScreen-AspectFill@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchScreen-Center.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchScreen-Center@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiresFullScreen</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina5_9" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchScreen.AspectFill" translatesAutoresizingMaskIntoConstraints="NO" id="wtH-rr-YfP">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchScreen.Center" translatesAutoresizingMaskIntoConstraints="NO" id="s1z-aa-wYv">
<rect key="frame" x="0.0" y="150" width="375" height="512"/>
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="s1z-aa-wYv" secondAttribute="trailing" id="4Rf-kf-vql"/>
<constraint firstAttribute="bottom" secondItem="wtH-rr-YfP" secondAttribute="bottom" id="5CS-At-4ka"/>
<constraint firstItem="wtH-rr-YfP" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="Awn-b8-xf1"/>
<constraint firstItem="s1z-aa-wYv" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="BpJ-vb-eKA"/>
<constraint firstItem="s1z-aa-wYv" firstAttribute="trailing" secondItem="wtH-rr-YfP" secondAttribute="trailing" id="QIM-7J-OZz"/>
<constraint firstAttribute="trailing" secondItem="wtH-rr-YfP" secondAttribute="trailing" id="RXg-rW-UK8"/>
<constraint firstItem="s1z-aa-wYv" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="Rcp-LG-48z"/>
<constraint firstItem="wtH-rr-YfP" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="cch-8E-tYu"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="509.60000000000002" y="237.93103448275863"/>
</scene>
</scenes>
<resources>
<image name="LaunchScreen.AspectFill" width="768" height="1024"/>
<image name="LaunchScreen.Center" width="384" height="512"/>
</resources>
</document>

View File

@@ -0,0 +1,7 @@
// You can add custom settings here
// for example you can uncomment the following line to force distribution code signing
// CODE_SIGN_IDENTITY = iPhone Distribution
// 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
// DEVELOPMENT_TEAM = YOUR_TEAM_ID;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;

View File

@@ -0,0 +1 @@
<Frame defaultPage="home/home-page" />

View File

@@ -0,0 +1,13 @@
/*
In NativeScript, the app.css file is where you place CSS rules that
you would like to apply to your entire application. Check out
http://docs.nativescript.org/ui/styling for a full list of the CSS
selectors and properties you can use to style UI components.
/*
For example, the following CSS rule changes the font size of all UI
components that have the btn class name.
*/
.btn {
font-size: 18;
}

View File

@@ -0,0 +1,4 @@
import * as application from "tns-core-modules/application";
application.run({ moduleName: "app-root" });
// application.run({ moduleName: "tab-root" });

View File

@@ -0,0 +1,61 @@
import * as application from "tns-core-modules/application";
import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
import { NavigatedData, Page } from "tns-core-modules/ui/page";
import { View, EventData } from "tns-core-modules/ui/core/view";
import { Frame } from "tns-core-modules/ui/frame";
export function onNavigatingTo(args: NavigatedData) {
const page = <StackLayout>args.object;
console.log("home-page onNavigatingTo");
}
export function onNavigatingFrom(args: NavigatedData) {
console.log("home-page onNavigatingFrom");
}
export function onNavigatedTo(args: NavigatedData) {
console.log("home-page onNavigatedTo");
}
export function onNavigatedFrom(args: NavigatedData) {
console.log("home-page onNavigatedFrom");
}
export function onModalFrame(args: EventData) {
const view = args.object as View;
const frame = new Frame();
frame.navigate("modal/modal-page");
view.showModal(frame,
"context",
() => console.log("home-page modal frame closed"),
false);
}
export function onModalPage(args: EventData) {
const view = args.object as View;
view.showModal("modal/modal-page",
{ frameless: true },
() => console.log("home-page modal page closed"),
false);
}
export function onModalTabView(args: EventData) {
const view = args.object as View;
view.showModal("modal-tab/modal-tab-root",
{ frameless: true },
() => console.log("home-page modal tabview closed"),
false);
}
export function onNavigate(args: EventData) {
const view = args.object as View;
const page = view.page as Page;
page.frame.navigate("second/second-page");
}
export function onRootViewChange() {
let rootView: View = application.getRootView();
rootView.typeName === "Frame" ? application._resetRootView({moduleName: "tab-root"}) : application._resetRootView({moduleName: "app-root"});
}

View File

@@ -0,0 +1,19 @@
<Page class="page"
navigatingTo="onNavigatingTo"
navigatingFrom="onNavigatingFrom"
navigatedTo="onNavigatedTo"
navigatedFrom="onNavigatedFrom"
xmlns="http://schemas.nativescript.org/tns.xsd">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="Home"></Label>
</ActionBar>
<StackLayout>
<Button text="Show Modal Page With Frame" tap="onModalFrame" />
<Button text="Show Modal Page" tap="onModalPage" />
<Button text="Show Modal TabView" tap="onModalTabView" />
<Button text="Navigate To Second Page" tap="onNavigate" />
<Button text="Change Root View" tap="onRootViewChange" />
</StackLayout>
</Page>

View File

@@ -0,0 +1,23 @@
import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
import { NavigatedData } from "tns-core-modules/ui/page";
import { View, EventData } from "tns-core-modules/ui/core/view";
export function onNavigatingTo(args: NavigatedData) {
console.log("NESTED modal-frame onNavigatingTo");
}
export function onNavigatingFrom(args: NavigatedData) {
console.log("NESTED modal-frame onNavigatingFrom");
}
export function onNavigatedTo(args: NavigatedData) {
console.log("NESTED modal-frame onNavigatedTo");
}
export function onNavigatedFrom(args: NavigatedData) {
console.log("NESTED modal-frame onNavigatedFrom");
}
export function closeModal(args: EventData) {
(args.object as View).closeModal();
}

View File

@@ -0,0 +1,14 @@
<Page backgroundColor="yellow"
navigatingTo="onNavigatingTo"
navigatingFrom="onNavigatingFrom"
navigatedTo="onNavigatedTo"
navigatedFrom="onNavigatedFrom">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="Nested Modal"></Label>
</ActionBar>
<StackLayout backgroundColor="darkBlue">
<Button text="Close Modal" tap="closeModal" />
</StackLayout>
</Page>

View File

@@ -0,0 +1,26 @@
import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
import { NavigatedData, Page } from "tns-core-modules/ui/page";
import { View, EventData } from "tns-core-modules/ui/core/view";
import { Frame } from "tns-core-modules/ui/frame";
export function onNavigatingTo(args: NavigatedData) {
console.log("second-page onNavigatingTo");
}
export function onNavigatingFrom(args: NavigatedData) {
console.log("second-page onNavigatingFrom");
}
export function onNavigatedTo(args: NavigatedData) {
console.log("second-page onNavigatedTo");
}
export function onNavigatedFrom(args: NavigatedData) {
console.log("second-page onNavigatedFrom");
}
export function onGoBack(args: EventData) {
const view = args.object as View;
const page = view.page as Page;
page.frame.goBack();
}

View File

@@ -0,0 +1,15 @@
<Page class="page"
navigatingTo="onNavigatingTo"
navigatingFrom="onNavigatingFrom"
navigatedTo="onNavigatedTo"
navigatedFrom="onNavigatedFrom"
xmlns="http://schemas.nativescript.org/tns.xsd">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="Modal Second"></Label>
</ActionBar>
<StackLayout>
<Button text="Go Back" tap="onGoBack" />
</StackLayout>
</Page>

View File

@@ -0,0 +1,9 @@
import { ShownModallyData } from "tns-core-modules/ui/core/view";
export function onShowingModally(args: ShownModallyData) {
console.log("modal tabview showingModally");
}
export function onShownModally(args: ShownModallyData) {
console.log("modal tabview shownModally");
}

View File

@@ -0,0 +1,8 @@
<TabView androidTabsPosition="bottom" showingModally="onShowingModally" shownModally="onShownModally">
<TabViewItem title="Modal First">
<Frame defaultPage="modal/modal-page" />
</TabViewItem>
<TabViewItem title="Modal Second">
<Frame defaultPage="modal-second/modal-second-page" />
</TabViewItem>
</TabView>

View File

@@ -0,0 +1,67 @@
import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
import { NavigatedData, Page } from "tns-core-modules/ui/page";
import { View, EventData } from "tns-core-modules/ui/core/view";
import { Frame, ShownModallyData } from "tns-core-modules/ui/frame";
import { fromObject } from "tns-core-modules/data/observable";
export function onShowingModally(args: ShownModallyData) {
console.log("modal-page showingModally");
let navigationVisibility = "visible";
if (args.context.frameless) {
navigationVisibility = "collapse";
}
(<any>args.object).bindingContext = fromObject({ navigationVisibility });
}
export function onLoaded(args) {
console.log("modal-page loaded");
}
export function onNavigatingTo(args: NavigatedData) {
console.log("modal-page onNavigatingTo");
}
export function onNavigatingFrom(args: NavigatedData) {
console.log("modal-page onNavigatingFrom");
}
export function onNavigatedTo(args: NavigatedData) {
console.log("modal-page onNavigatedTo");
}
export function onNavigatedFrom(args: NavigatedData) {
console.log("modal-page onNavigatedFrom");
}
export function closeModal(args: EventData) {
(args.object as View).closeModal();
}
export function showNestedModalPage(args: EventData) {
const view = args.object as View;
view.showModal("modal-nested/modal-nested-page",
"nested-context",
() => console.log("modal page nested closed"),
false);
}
export function showNestedModalFrame(args: EventData) {
const view = args.object as View;
const frame = new Frame();
frame.navigate("modal-nested/modal-nested-page");
view.showModal(frame,
"nested-context",
() => console.log("modal frame nested closed"),
false);
}
export function onNavigate(args: EventData) {
const view = args.object as View;
const page = view.page as Page;
page.frame.navigate("modal-second/modal-second-page");
}

View File

@@ -0,0 +1,17 @@
<Page backgroundColor="green" showingModally="onShowingModally" loaded="onLoaded"
navigatingTo="onNavigatingTo"
navigatingFrom="onNavigatingFrom"
navigatedTo="onNavigatedTo"
navigatedFrom="onNavigatedFrom">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="Modal"></Label>
</ActionBar>
<StackLayout backgroundColor="maroon">
<Button text="Navigate To Second Page" tap="onNavigate" visibility="{{ navigationVisibility }}" />
<Button text="Show Nested Modal Page" tap="showNestedModalPage" />
<Button text="Show Nested Modal Page With Frame" tap="showNestedModalFrame" />
<Button text="Close Modal" tap="closeModal" />
</StackLayout>
</Page>

View File

@@ -0,0 +1,8 @@
{
"android": {
"v8Flags": "--expose_gc"
},
"main": "app.js",
"name": "tns-template-hello-world-ts",
"version": "3.4.0"
}

View File

@@ -0,0 +1,46 @@
import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
import { NavigatedData, Page } from "tns-core-modules/ui/page";
import { View, EventData } from "tns-core-modules/ui/core/view";
import { Frame } from "tns-core-modules/ui/frame";
export function onNavigatingTo(args: NavigatedData) {
console.log("second-page onNavigatingTo");
}
export function onNavigatingFrom(args: NavigatedData) {
console.log("second-page onNavigatingFrom");
}
export function onNavigatedTo(args: NavigatedData) {
console.log("second-page onNavigatedTo");
}
export function onNavigatedFrom(args: NavigatedData) {
console.log("second-page onNavigatedFrom");
}
export function onGoBack(args: EventData) {
const view = args.object as View;
const page = view.page as Page;
page.frame.goBack();
}
export function onModalFrame(args: EventData) {
const view = args.object as View;
const frame = new Frame();
frame.navigate("modal/modal-page");
view.showModal(frame,
"context",
() => console.log("home-page modal frame closed"),
false);
}
export function onModalPage(args: EventData) {
const view = args.object as View;
view.showModal("modal/modal-page",
{ frameless: true },
() => console.log("home-page modal page closed"),
false);
}

View File

@@ -0,0 +1,17 @@
<Page class="page"
navigatingTo="onNavigatingTo"
navigatingFrom="onNavigatingFrom"
navigatedTo="onNavigatedTo"
navigatedFrom="onNavigatedFrom"
xmlns="http://schemas.nativescript.org/tns.xsd">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="Second"></Label>
</ActionBar>
<StackLayout>
<Button text="Show Modal Page With Frame" tap="onModalFrame" />
<Button text="Show Modal Page" tap="onModalPage" />
<Button text="Go Back" tap="onGoBack" />
</StackLayout>
</Page>

View File

@@ -0,0 +1,8 @@
<TabView androidTabsPosition="bottom">
<TabViewItem title="First">
<Frame defaultPage="home/home-page" />
</TabViewItem>
<TabViewItem title="Second">
<Frame defaultPage="second/second-page" />
</TabViewItem>
</TabView>

View File

@@ -0,0 +1,28 @@
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.modalnavigation",
"tns-ios": {
"version": "3.4.1"
},
"tns-android": {
"version": "3.4.1"
}
},
"dependencies": {
"nativescript-theme-core": "~1.0.4",
"tns-core-modules": "*"
},
"devDependencies": {
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
"lazy": "1.0.11",
"nativescript-dev-typescript": "~0.6.0",
"tns-platform-declarations": "*",
"typescript": "~2.4.2"
}
}

View File

@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noEmitHelpers": true,
"noEmitOnError": true,
"lib": [
"es6",
"dom"
],
"baseUrl": ".",
"paths": {
"*": [
"./node_modules/tns-core-modules/*",
"./node_modules/*"
]
}
},
"exclude": [
"node_modules",
"platforms"
]
}

View File

@@ -46,7 +46,7 @@
"typescript": "^2.6.1"
},
"scripts": {
"setup": "npm run dev-link-tns-platform-declarations && npm run dev-link-tns-core-modules && npm run dev-link-tests && npm run dev-link-apps",
"setup": "npm run dev-link-tns-platform-declarations && npm run dev-link-tns-core-modules && npm run dev-link-tests && npm run dev-link-apps && npm run dev-link-e2e-modal",
"tsc": "node --max_old_space_size=4096 ./node_modules/typescript/bin/tsc",
"ci": "tsc && npm run tslint && npm run ci-apps && npm run ci-tests",
"ci-apps": "cd apps && npm i ../tns-core-modules ../tns-platform-declarations --save",
@@ -62,11 +62,13 @@
"dev-tsc-tns-platform-declarations": "npm run tsc -- -p tns-platform-declarations",
"dev-tsc-tests": "npm run tsc -- -p tests",
"dev-tsc-apps": "npm run tsc -- -p apps",
"dev-tsc-all": "npm run dev-tsc-tns-platform-declarations && npm run tsc && npm run dev-tsc-tests && npm run dev-tsc-apps",
"dev-tsc-e2e": "npm run tsc -- -p e2e",
"dev-tsc-all": "npm run dev-tsc-tns-platform-declarations && npm run tsc && npm run dev-tsc-tests && npm run dev-tsc-apps && && npm run dev-tsc-e2e",
"dev-link-tns-platform-declarations": "cd tns-platform-declarations && npm link",
"dev-link-tns-core-modules": "cd tns-core-modules && npm link",
"dev-link-tests": "cd tests && npm link tns-platform-declarations && npm link tns-core-modules",
"dev-link-apps": "cd apps && npm link tns-platform-declarations && npm link tns-core-modules",
"dev-link-e2e-modal": "cd e2e && cd modal-navigation && npm link tns-platform-declarations && npm link tns-core-modules",
"dev-declarations": "npm run setup && rm -rf tns-platform-declarations/ios/objc* && TNS_TYPESCRIPT_DECLARATIONS_PATH=$PWD/tns-platform-declarations/ios/objc tns build ios --path tests",
"test": "npm run test-android && npm run test-ios",
"pretest": "npm run setup && npm run tsc",
@@ -78,7 +80,7 @@
"typedoc": "typedoc --tsconfig tsconfig.typedoc.json --out bin/dist/apiref --includeDeclarations --name NativeScript --theme ./node_modules/nativescript-typedoc-theme --excludeExternals --externalPattern \"**/+(tns-core-modules|module).d.ts\"",
"dev-typedoc": "npm run typedoc && cd bin/dist/apiref && http-server",
"test-tsc-es2016": "npm run tsc -- -p tsconfig.public.es2016.json",
"tslint": "tslint --config build/tslint.json 'tns-core-modules/**/*.ts' 'tests/**/*.ts' 'apps/**/*.ts' -e '**/node_modules/**' -e '**/platforms/**'",
"tslint": "tslint --config build/tslint.json 'tns-core-modules/**/*.ts' 'tests/**/*.ts' 'apps/**/*.ts' 'e2e/**/*.ts' -e '**/node_modules/**' -e '**/platforms/**'",
"madge-ios": "tsc --skipLibCheck && tns prepare ios --path tests && madge --circular tests/platforms/ios/tests/app/tns_modules/tns-core-modules",
"madge-ios-image": "tsc --skipLibCheck && tns prepare ios --path tests && madge --image graph-tests-ios.svg tests/platforms/ios/tests/app/tns_modules/tns-core-modules",
"madge-android": "tsc --skipLibCheck && tns prepare android --path tests && madge --circular tests/platforms/android/src/main/assets/app/tns_modules/tns-core-modules",

View File

@@ -12,6 +12,8 @@
"apps/node_modules",
"apps/package/",
"apps/platforms",
"e2e/node_modules",
"e2e/platforms",
"node_modules/",
"package/",
"bin",