test: add e2e app for nested frame scenarios (#6626)

This commit is contained in:
Manol Donev
2018-11-28 16:59:17 +02:00
committed by GitHub
parent c8341819a3
commit f87ec4bc08
113 changed files with 3068 additions and 0 deletions

View File

@ -0,0 +1 @@
.vscode/settings.json

View File

@ -0,0 +1,100 @@
{
// 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": [
{
"type": "node",
"request": "launch",
"name": "Launch Tests on Android",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
// "${workspaceFolder}/test",
"--opts",
"./e2e/config/mocha.opts",
"--runType",
"android23",
"--reuseDevice",
"--verbose"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "Launch Tests on iOS",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
// "${workspaceFolder}/test",
"--opts",
"./e2e/config/mocha.opts",
"--runType",
"sim.iPhoneX.iOS112",
"--reuseDevice",
"--verbose"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "Launch on iOS",
"type": "nativescript",
"request": "launch",
"platform": "ios",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"stopOnEntry": false,
"tnsArgs": [
"--syncAllFiles"
],
"watch": true
},
{
"name": "Attach on iOS",
"type": "nativescript",
"request": "attach",
"platform": "ios",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"tnsArgs": [
"--syncAllFiles"
],
"watch": false
},
{
"name": "Launch on Android",
"type": "nativescript",
"request": "launch",
"platform": "android",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"stopOnEntry": false,
"tnsArgs": [
"--syncAllFiles"
],
"watch": true
},
{
"name": "Attach on Android",
"type": "nativescript",
"request": "attach",
"platform": "android",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"tnsArgs": [
"--syncAllFiles"
],
"watch": false
}
]
}

View File

@ -0,0 +1,14 @@
Execute Tests
=============
Android:
```
npm run e2e -- --runType android23 # --devMode
```
iOS:
```
npm run e2e -- --runType sim.iPhoneX.iOS112 # --devMode
```

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.nestedframenavigation"
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

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"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

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"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

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"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 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"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

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,35 @@
Button {
font-size: 8;
padding-left: 5;
padding-right: 5;
padding-top: 0;
padding-bottom: 0;
margin-top: 0;
margin-bottom: 0;
margin-right: 0;
height: 50px;
color: blue;
}
TextView {
font-size: 10;
margin: 0;
padding: 0;
color: green;
}
Label {
font-size: 10;
margin: 0;
padding: 0;
}
GridLayout {
margin: 0;
padding: 0;
}
ActionBar {
height: 30;
margin: 0;
}

View File

View File

@ -0,0 +1,7 @@
Button{
color: blue;
}
TextView{
color: green;
}

View File

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

View File

@ -0,0 +1,46 @@
import { EventData } from "tns-core-modules/ui/page";
import { Button } from "tns-core-modules/ui/button";
export function onNavigate(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate("some-page/some-page");
}
export function onNavigateNone(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate({
moduleName: "some-page/some-page",
animated: false
});
}
export function onNavigateSlide(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate({
moduleName: "some-page/some-page",
animated: true,
transition: {
name: "slide",
duration: 380,
curve: "easeIn"
}
});
}
export function onNavigateFlip(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate({
moduleName: "some-page/some-page",
animated: true,
transition: {
name: "flip",
duration: 380,
curve: "easeIn"
}
});
}
export function onBackButtonTap(args: EventData): void {
const button = <Button>args.object;
button.page.frame.goBack();
}

View File

@ -0,0 +1,21 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
<ActionBar class="action-bar">
<NavigationButton text="frameHomeBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<Label class="action-bar-title" text="frame home page" horizontalAlignment="center" />
</ActionBar>
<GridLayout rows="auto, *">
<StackLayout>
<Button text="navigate to some page (default transition)" tap="onNavigate" />
<Button text="navigate to some page (no transition)" tap="onNavigateNone" />
<Button text="navigate to some page (slide transition)" tap="onNavigateSlide" />
<Button text="navigate to some page (flip transition)" tap="onNavigateFlip" />
</StackLayout>
<GridLayout row="1">
<Frame defaultPage="players/players-items-page" />
</GridLayout>
</GridLayout>
</Page>

View File

@ -0,0 +1,24 @@
<Page codeFile="~/frame-root/frame-home-page" xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
<ActionBar class="action-bar">
<NavigationButton text="frameHomeBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<Label class="action-bar-title" text="multi frame home page" horizontalAlignment="center" />
</ActionBar>
<GridLayout rows="auto, *, *">
<StackLayout>
<Button text="navigate to some page (default transition)" tap="onNavigate" />
<Button text="navigate to some page (no transition)" tap="onNavigateNone" />
<Button text="navigate to some page (slide transition)" tap="onNavigateSlide" />
<Button text="navigate to some page (flip transition)" tap="onNavigateFlip" />
</StackLayout>
<GridLayout row="1">
<Frame defaultPage="players/players-items-page" />
</GridLayout>
<GridLayout row="2">
<Frame defaultPage="teams/teams-items-page" />
</GridLayout>
</GridLayout>
</Page>

View File

@ -0,0 +1,39 @@
import * as application from "tns-core-modules/application";
import { EventData } from "tns-core-modules/ui/core/view";
import { Button } from "tns-core-modules/ui/button";
export function onNavigateToLayoutFrame(args: EventData) {
application._resetRootView({ moduleName: "layout-root/layout-root-frame" });
}
export function onNavigateToLayoutMultiFrame(args: EventData) {
application._resetRootView({ moduleName: "layout-root/layout-root-multi-frame" });
}
export function onNavigateToPageFrame(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate("frame-root/frame-home-page");
}
export function onNavigateToPageMultiFrame(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate("frame-root/frame-multi-home-page");
}
export function onNavigateToTabsTopPage(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate("tab-page/tabs-top-page");
}
export function onNavigateToTabsBottomPage(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate("tab-page/tabs-bottom-page");
}
export function onNavigateToTabsTopRoot(args: EventData) {
application._resetRootView({ moduleName: "tab-root/tab-root-top" });
}
export function onNavigateToTabsBottomRoot(args: EventData) {
application._resetRootView({ moduleName: "tab-root/tab-root-bottom" });
}

View File

@ -0,0 +1,19 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
<ActionBar class="action-bar" height="5%">
<Label class="action-bar-title" text="Home" />
</ActionBar>
<GridLayout rows="auto">
<StackLayout id="home-page" borderColor="yellowgreen" borderWidth="1" borderRadius="5" padding="2">
<Button text="Layout w/ frame" tap="onNavigateToLayoutFrame" />
<Button text="Layout w/ multi frame" tap="onNavigateToLayoutMultiFrame" />
<Button text="Page w/ frame" tap="onNavigateToPageFrame" />
<Button text="Page w/ multi frame" tap="onNavigateToPageMultiFrame" />
<Button ios:visibility="collapsed" text="Page w/ tabs (top)" tap="onNavigateToTabsTopPage" />
<Button text="Page w/ tabs (bottom)" tap="onNavigateToTabsBottomPage" />
<Button ios:visibility="collapsed" text="Root tabs (top)" tap="onNavigateToTabsTopRoot" />
<Button text="Root tabs (bottom)" tap="onNavigateToTabsBottomRoot" />
</StackLayout>
</GridLayout>
</Page>

View File

@ -0,0 +1,41 @@
import { EventData } from "tns-core-modules/ui/page";
import { Button } from "tns-core-modules/ui/button";
export function onNavigate(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate("some-page/some-page");
}
export function onNavigateNone(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate({
moduleName: "some-page/some-page",
animated: false
});
}
export function onNavigateSlide(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate({
moduleName: "some-page/some-page",
animated: true,
transition: {
name: "slide",
duration: 380,
curve: "easeIn"
}
});
}
export function onNavigateFlip(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate({
moduleName: "some-page/some-page",
animated: true,
transition: {
name: "flip",
duration: 380,
curve: "easeIn"
}
});
}

View File

@ -0,0 +1,20 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="layout home page" horizontalAlignment="center" />
</ActionBar>
<GridLayout rows="auto, *">
<StackLayout>
<Button text="navigate to some page (default transition)" tap="onNavigate" />
<Button text="navigate to some page (no transition)" tap="onNavigateNone" />
<Button text="navigate to some page (slide transition)" tap="onNavigateSlide" />
<Button text="navigate to some page (flip transition)" tap="onNavigateFlip" />
</StackLayout>
<GridLayout row="1">
<Frame defaultPage="players/players-items-page" />
</GridLayout>
</GridLayout>
</Page>

View File

@ -0,0 +1,41 @@
import { EventData } from "tns-core-modules/ui/page";
import { Button } from "tns-core-modules/ui/button";
export function onNavigate(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate("other-page/other-page");
}
export function onNavigateNone(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate({
moduleName: "other-page/other-page",
animated: false
});
}
export function onNavigateSlide(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate({
moduleName: "other-page/other-page",
animated: true,
transition: {
name: "slide",
duration: 380,
curve: "easeIn"
}
});
}
export function onNavigateFlip(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate({
moduleName: "other-page/other-page",
animated: true,
transition: {
name: "flip",
duration: 380,
curve: "easeIn"
}
});
}

View File

@ -0,0 +1,20 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="layout home secondary page" horizontalAlignment="center" />
</ActionBar>
<GridLayout rows="auto, *">
<StackLayout>
<Button text="navigate to other page (default transition)" tap="onNavigate" />
<Button text="navigate to other page (no transition)" tap="onNavigateNone" />
<Button text="navigate to other page (slide transition)" tap="onNavigateSlide" />
<Button text="navigate to other page (flip transition)" tap="onNavigateFlip" />
</StackLayout>
<GridLayout row="1">
<Frame defaultPage="teams/teams-items-page" />
</GridLayout>
</GridLayout>
</Page>

View File

@ -0,0 +1,5 @@
import * as application from "tns-core-modules/application";
export function onReset() {
application._resetRootView({ moduleName: "app-root" });
}

View File

@ -0,0 +1,6 @@
<GridLayout rows="auto, *">
<Button text="reset app" tap="onReset" />
<GridLayout row="1">
<Frame defaultPage="layout-root/layout-home-page" />
</GridLayout>
</GridLayout>

View File

@ -0,0 +1,9 @@
<GridLayout codeFile="~/layout-root/layout-root-frame" rows="auto, *, *">
<Button text="reset app" tap="onReset" />
<GridLayout row="1">
<Frame defaultPage="layout-root/layout-home-page" />
</GridLayout>
<GridLayout row="2">
<Frame defaultPage="layout-root/layout-home-secondary-page" />
</GridLayout>
</GridLayout>

View File

@ -0,0 +1,7 @@
import { EventData } from "tns-core-modules/ui/page";
import { Button } from "tns-core-modules/ui/button";
export function onBackButtonTap(args: EventData): void {
const button = <Button>args.object;
button.page.frame.goBack();
}

View File

@ -0,0 +1,12 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
<ActionBar class="action-bar">
<NavigationButton text="otherPageBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<Label class="action-bar-title" text="other page" />
</ActionBar>
<GridLayout>
</GridLayout>
</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,14 @@
import { EventData, View } from "tns-core-modules/ui/core/view";
import { NavigatedData, Page } from "tns-core-modules/ui/page";
import { Item } from "../../shared/item";
export function onNavigatingTo(args: NavigatedData) {
const page = args.object as Page;
const item = args.context as Item;
page.bindingContext = item;
}
export function onBackButtonTap(args: EventData) {
const view = args.object as View;
view.page.frame.goBack();
}

View File

@ -0,0 +1,12 @@
<Page class="page" navigatingTo="onNavigatingTo" xmlns="http://schemas.nativescript.org/tns.xsd">
<ActionBar class="action-bar">
<NavigationButton text="playerBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back"/>
<Label class="action-bar-title" text="{{ name }}"></Label>
</ActionBar>
<GridLayout>
<Label class="m-10 h3" verticalAlignment="top" text="{{ description }}"></Label>
</GridLayout>
</Page>

View File

@ -0,0 +1,55 @@
import { View } from "tns-core-modules/ui/core/view";
import { ItemEventData } from "tns-core-modules/ui/list-view";
import { NavigatedData, Page } from "tns-core-modules/ui/page";
import { NavigationEntry } from "tns-core-modules/ui/frame";
import { ItemsViewModel } from "../shared/items-view-model";
import { Item } from "../shared/item";
export function onNavigatingTo(args: NavigatedData) {
const page = <Page>args.object;
page.bindingContext = new ItemsViewModel(new Array<Item>(
{ id: 1, name: "Player One (default transition)", description: "Goalkeeper", transition: "default" },
{ id: 2, name: "Player Two (default transition)", description: "Defender", transition: "default" },
{ id: 3, name: "Player One (no transition)", description: "Goalkeeper", transition: "none" },
{ id: 4, name: "Player Two (no transition)", description: "Defender", transition: "none" },
{ id: 5, name: "Player One (slide transition)", description: "Goalkeeper", transition: "slide" },
{ id: 6, name: "Player Two (slide transition)", description: "Defender", transition: "slide" },
{ id: 7, name: "Player One (flip transition)", description: "Goalkeeper", transition: "flip" },
{ id: 8, name: "Player Two (flip transition)", description: "Defender", transition: "flip" }
));
}
export function onItemTap(args: ItemEventData) {
const view = <View>args.view;
const page = <Page>view.page;
const tappedItem = <Item>view.bindingContext;
const entry: NavigationEntry = {
moduleName: "players/player-item-detail/player-item-detail-page",
context: tappedItem
};
switch (tappedItem.transition) {
case "none":
entry.animated = false;
break;
case "slide":
entry.transition = {
name: "slide",
duration: 380,
curve: "easeIn"
};
break;
case "flip":
entry.transition = {
name: "flip",
duration: 380,
curve: "easeIn"
};
break;
}
page.frame.navigate(entry);
}

View File

@ -0,0 +1,14 @@
<Page class="page" navigatingTo="onNavigatingTo" xmlns="http://schemas.nativescript.org/tns.xsd">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="Players"></Label>
</ActionBar>
<ListView items="{{ items }}" itemTap="onItemTap" class="list-group">
<ListView.itemTemplate>
<StackLayout orientation="horizontal" class="list-group-item">
<Label text="{{ name }}" textWrap="true"></Label>
</StackLayout>
</ListView.itemTemplate>
</ListView>
</Page>

View File

@ -0,0 +1,6 @@
export interface Item {
id: number;
name: string;
description: string;
transition: string;
}

View File

@ -0,0 +1,9 @@
import { Observable } from "tns-core-modules/data/observable";
import { Item } from "./item";
export class ItemsViewModel extends Observable {
constructor(public items: Array<Item>) {
super();
}
}

View File

@ -0,0 +1,7 @@
import { EventData } from "tns-core-modules/ui/page";
import { Button } from "tns-core-modules/ui/button";
export function onBackButtonTap(args: EventData): void {
const button = <Button>args.object;
button.page.frame.goBack();
}

View File

@ -0,0 +1,12 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
<ActionBar class="action-bar">
<NavigationButton text="somePageBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<Label class="action-bar-title" text="some page" />
</ActionBar>
<GridLayout>
</GridLayout>
</Page>

View File

@ -0,0 +1,31 @@
<Page codeFile="~/tab-page/tabs-page" xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
<ActionBar class="action-bar">
<NavigationButton text="tabBottomBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<Label class="action-bar-title" text="tab bottom page" horizontalAlignment="center" />
</ActionBar>
<GridLayout rows="auto, *">
<StackLayout>
<Button text="navigate to some page (default transition)" tap="onNavigate" />
<Button text="navigate to some page (no transition)" tap="onNavigateNone" />
<Button text="navigate to some page (slide transition)" tap="onNavigateSlide" />
<Button text="navigate to some page (flip transition)" tap="onNavigateFlip" />
</StackLayout>
<GridLayout row="1">
<TabView androidTabsPosition="bottom">
<TabViewItem title="Players">
<Frame defaultPage="players/players-items-page" />
</TabViewItem>
<TabViewItem title="Dummy">
<!-- this tab serves as dummy so the actual teams tab is not loaded by default -->
<Label text="this is a tab" />
</TabViewItem>
<TabViewItem title="Teams">
<Frame defaultPage="teams/teams-items-page" />
</TabViewItem>
</TabView>
</GridLayout>
</GridLayout>
</Page>

View File

@ -0,0 +1,46 @@
import { EventData } from "tns-core-modules/ui/page";
import { Button } from "tns-core-modules/ui/button";
export function onNavigate(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate("some-page/some-page");
}
export function onNavigateNone(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate({
moduleName: "some-page/some-page",
animated: false
});
}
export function onNavigateSlide(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate({
moduleName: "some-page/some-page",
animated: true,
transition: {
name: "slide",
duration: 380,
curve: "easeIn"
}
});
}
export function onNavigateFlip(args: EventData) {
const button = <Button>args.object;
button.page.frame.navigate({
moduleName: "some-page/some-page",
animated: true,
transition: {
name: "flip",
duration: 380,
curve: "easeIn"
}
});
}
export function onBackButtonTap(args: EventData): void {
const button = <Button>args.object;
button.page.frame.goBack();
}

View File

@ -0,0 +1,28 @@
<Page codeFile="~/tab-page/tabs-page" xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
<ActionBar class="action-bar">
<NavigationButton text="tabTopBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<Label class="action-bar-title" text="tab top page" horizontalAlignment="center" />
</ActionBar>
<GridLayout rows="auto, *">
<StackLayout>
<Button text="navigate to some page (default transition)" tap="onNavigate" />
<Button text="navigate to some page (no transition)" tap="onNavigateNone" />
<Button text="navigate to some page (slide transition)" tap="onNavigateSlide" />
<Button text="navigate to some page (flip transition)" tap="onNavigateFlip" />
</StackLayout>
<TabView row="1" androidTabsPosition="top">
<TabViewItem title="Players">
<Frame defaultPage="players/players-items-page" />
</TabViewItem>
<TabViewItem title="Dummy">
<Label text="this is a tab" />
</TabViewItem>
<TabViewItem title="Teams">
<Frame defaultPage="teams/teams-items-page" />
</TabViewItem>
</TabView>
</GridLayout>
</Page>

View File

@ -0,0 +1,23 @@
<TabView codeFile="~/tab-root/tab-root" androidTabsPosition="bottom">
<TabViewItem title="Players">
<GridLayout rows="auto, auto, *">
<Label text="tab root bottom home" />
<Button row="1" text="reset app" tap="onReset" />
<GridLayout row="2">
<Frame defaultPage="players/players-items-page" />
</GridLayout>
</GridLayout>
</TabViewItem>
<TabViewItem title="Dummy">
<!-- this tab serves as dummy so the actual teams tab is not loaded by default -->
<Label text="this is a tab" />
</TabViewItem>
<TabViewItem title="Teams">
<GridLayout rows="auto, *">
<Button text="reset app" tap="onReset" />
<GridLayout row="1">
<Frame defaultPage="teams/teams-items-page" />
</GridLayout>
</GridLayout>
</TabViewItem>
</TabView>

View File

@ -0,0 +1,21 @@
<TabView codeFile="~/tab-root/tab-root" androidTabsPosition="top">
<TabViewItem title="Players">
<GridLayout rows="auto, auto, *">
<Label text="tab root top home" />
<Button row="1" text="reset app" tap="onReset" />
<GridLayout row="2">
<Frame defaultPage="players/players-items-page" />
</GridLayout>
</GridLayout>
</TabViewItem>
<TabViewItem title="Dummy">
<!-- this tab serves as dummy so the actual teams tab is not loaded by default -->
<Label text="this is a tab" />
</TabViewItem>
<TabViewItem title="Teams">
<GridLayout rows="auto, *">
<Button text="reset app" tap="onReset" />
<Frame row="1" defaultPage="teams/teams-items-page" />
</GridLayout>
</TabViewItem>
</TabView>

View File

@ -0,0 +1,5 @@
import * as application from "tns-core-modules/application";
export function onReset() {
application._resetRootView({ moduleName: "app-root" });
}

View File

@ -0,0 +1,14 @@
import { EventData, View } from "tns-core-modules/ui/core/view";
import { NavigatedData, Page } from "tns-core-modules/ui/page";
import { Item } from "../../shared/item";
export function onNavigatingTo(args: NavigatedData) {
const page = args.object as Page;
const item = args.context as Item;
page.bindingContext = item;
}
export function onBackButtonTap(args: EventData) {
const view = args.object as View;
view.page.frame.goBack();
}

View File

@ -0,0 +1,12 @@
<Page class="page" navigatingTo="onNavigatingTo" xmlns="http://schemas.nativescript.org/tns.xsd">
<ActionBar class="action-bar">
<NavigationButton text="teamBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back"/>
<Label class="action-bar-title" text="{{ name }}"></Label>
</ActionBar>
<GridLayout>
<Label class="m-10 h3" verticalAlignment="top" text="{{ description }}"></Label>
</GridLayout>
</Page>

Some files were not shown because too many files have changed in this diff Show More