feat(monorepo): initial setup
5
.ackrc
@@ -1,5 +0,0 @@
|
||||
--ignore-file=ext:js
|
||||
--ignore-dir=is:bin
|
||||
--ignore-file=is:android17.d.ts
|
||||
--ignore-file=is:ios.d.ts
|
||||
--ignore-file=match:tscommand.*
|
||||
@@ -1,5 +0,0 @@
|
||||
node_modules
|
||||
android17.d.ts
|
||||
ios.d.ts
|
||||
*.js
|
||||
bin
|
||||
13
.editorconfig
Normal file
@@ -0,0 +1,13 @@
|
||||
# Editor configuration, see http://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = tab
|
||||
indent_size = 2
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
max_line_length = off
|
||||
trim_trailing_whitespace = false
|
||||
41
.eslintrc
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018,
|
||||
"sourceType": "module",
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"ignorePatterns": ["**/*"],
|
||||
"plugins": ["@typescript-eslint", "@nrwl/nx"],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier",
|
||||
"prettier/@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/explicit-member-accessibility": "off",
|
||||
"@typescript-eslint/explicit-function-return-type": "off",
|
||||
"@typescript-eslint/no-parameter-properties": "off",
|
||||
"@nrwl/nx/enforce-module-boundaries": [
|
||||
"error",
|
||||
{
|
||||
"enforceBuildableLibDependency": true,
|
||||
"allow": [],
|
||||
"depConstraints": [
|
||||
{ "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.tsx"],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-unused-vars": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
26
.gitattributes
vendored
@@ -1,26 +0,0 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Use LF for shell scripts
|
||||
*.sh eol=lf
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
*.sln merge=union
|
||||
*.csproj merge=union
|
||||
*.vbproj merge=union
|
||||
*.fsproj merge=union
|
||||
*.dbproj merge=union
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
||||
|
||||
35
.github/workflows/npm_release.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: Release @nativescript/core to NPM
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ 'feat/monorepo' ]
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup
|
||||
run: npm install
|
||||
|
||||
- name: Generate Version
|
||||
working-directory: packages/core
|
||||
run: echo ::set-env name=NPM_VERSION::$(node -e "console.log(require('./package.json').version);")--$(date +"%m-%d-%Y-%s")-$GITHUB_RUN_NUMBER
|
||||
|
||||
- name: Bump Version
|
||||
working-directory: packages/core
|
||||
run: npm version $NPM_VERSION
|
||||
|
||||
- name: Build @nativescript/core
|
||||
run: npx nx run core:build.npm
|
||||
|
||||
- name: Publish @nativescript/core
|
||||
working-directory: dist/packages
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||
run: |
|
||||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
|
||||
echo "Publishing @nativescript/core@$NPM_VERSION to NPM..."
|
||||
npm publish nativescript-core-$NPM_VERSION.tgz --tag ci --dry-run
|
||||
91
.gitignore
vendored
@@ -1,22 +1,14 @@
|
||||
# Folders
|
||||
dist
|
||||
hooks
|
||||
ios-typings-prj
|
||||
libs
|
||||
node_modules
|
||||
package
|
||||
platforms
|
||||
!nativescript-core/platforms
|
||||
reports
|
||||
tags
|
||||
temp
|
||||
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
# Files
|
||||
# compiled output
|
||||
/dist
|
||||
/tmp
|
||||
/out-tsc
|
||||
|
||||
# dependencies
|
||||
node_modules
|
||||
package-lock.json
|
||||
.DS_Store
|
||||
.nsbuildinfo
|
||||
tsdoc-metadata.json
|
||||
thumbs.db
|
||||
yarn-lock.json
|
||||
|
||||
# IDEs and editors
|
||||
/.idea
|
||||
@@ -25,8 +17,7 @@ thumbs.db
|
||||
.c9/
|
||||
*.launch
|
||||
.settings/
|
||||
.atom
|
||||
.ctags-exclude
|
||||
*.sublime-workspace
|
||||
|
||||
# IDE - VSCode
|
||||
.vscode/*
|
||||
@@ -35,49 +26,25 @@ thumbs.db
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
# Appium files
|
||||
mochawesome-report
|
||||
e2e/**/*.trace/
|
||||
e2e/**/test-results.xml
|
||||
e2e/**/e2e/resources/
|
||||
|
||||
# Webpack configuration files
|
||||
webpack.config.js
|
||||
tsconfig.esm.json
|
||||
tsconfig.tns.json
|
||||
|
||||
# Generated files
|
||||
*.map
|
||||
# misc
|
||||
/.sass-cache
|
||||
/connect.lock
|
||||
/coverage
|
||||
/libpeerconnection.log
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
testem.log
|
||||
/typings
|
||||
apps/**/*/*.js
|
||||
apps/**/*/*.map
|
||||
apps/**/*/platforms
|
||||
apps/**/*/webpack.*.js
|
||||
*.tgz
|
||||
.baseDir.ts
|
||||
tscommand*.tmp.txt
|
||||
.tscache
|
||||
|
||||
# Other
|
||||
*.js
|
||||
!tns-core-modules-package/**/*.js
|
||||
# System Files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# core
|
||||
# https://github.com/NativeScript/nativescript-dev-webpack/issues/932
|
||||
!nativescript-core/xml/xml.js
|
||||
!tests/hooks/**/*.*
|
||||
!nativescript-core/js-libs/**/*.*
|
||||
!nativescript-core/cli-hooks/**/*.*
|
||||
!nativescript-core/css/**/*.*
|
||||
nativescript-core/css/parser.js*
|
||||
nativescript-core/css/system-classes.js*
|
||||
!nativescript-core/css-value/**/*.*
|
||||
!nativescript-core/fetch/**/*.*
|
||||
!nativescript-core/build/**/*.*
|
||||
|
||||
#generated by api-extractor
|
||||
nativescript-core/nativescript-core.d.ts
|
||||
|
||||
.vs/
|
||||
e2e/*
|
||||
!e2e/animation
|
||||
!e2e/config
|
||||
!e2e/cuteness.io
|
||||
!e2e/file-qualifiers
|
||||
!e2e/modal-navigation
|
||||
!e2e/nested-frame-navigation
|
||||
!e2e/scoped-packages
|
||||
!e2e/ui-tests-app
|
||||
!packages/core/xml/index.js
|
||||
22
.prettierignore
Normal file
@@ -0,0 +1,22 @@
|
||||
.github
|
||||
.gitignore
|
||||
.npmignore
|
||||
*.yml
|
||||
.vscode
|
||||
build
|
||||
coverage
|
||||
dist
|
||||
e2e
|
||||
js-libs
|
||||
platforms
|
||||
tests
|
||||
packages/types-android
|
||||
packages/types-ios
|
||||
packages/ui-mobile-base
|
||||
*.cmd
|
||||
*.md
|
||||
*.json
|
||||
*.js
|
||||
*.map
|
||||
*.css
|
||||
*.scss
|
||||
6
.prettierrc.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"useTabs": true,
|
||||
"printWidth": 600,
|
||||
"tabWidth": 2,
|
||||
"singleQuote": true
|
||||
}
|
||||
13
.travis.yml
@@ -2,16 +2,9 @@ language: node_js
|
||||
node_js:
|
||||
- "node"
|
||||
script:
|
||||
- npm install
|
||||
- npm run tslint
|
||||
- npm run setup
|
||||
- npm run unit-test
|
||||
- nx run core:unit
|
||||
- nx run core:build.npm
|
||||
|
||||
# public API changes check
|
||||
- npm run api-extractor-ci
|
||||
|
||||
# circular references check
|
||||
- cd tests && npm i
|
||||
- node_modules/.bin/webpack --env.android
|
||||
- node_modules/.bin/webpack --env.ios
|
||||
|
||||
# - npm run api-extractor-ci
|
||||
|
||||
44
AUTHORS
@@ -1,44 +0,0 @@
|
||||
Alexander Vakrilov <alexander.vakrilov@telerik.com>
|
||||
Andrew Kulakov <avk@8xx8.ru>
|
||||
Antoine Rousseau <antoine@rousseau.im>
|
||||
Chi Liu <genexliu@gmail.com>
|
||||
Darin Dimitrov <darin.dimitrov@telerik.com>
|
||||
Dimitar Topuzov <dimitar.topuzov@telerik.com>
|
||||
Emil Öberg <emil.oberg@monator.com>
|
||||
Erjan Gavalji <erjan.gavalji@telerik.com>
|
||||
Fırat Yalavuz <yalavuz@gmail.com>
|
||||
Georgi Atanasov <georgi.atanasov@telerik.com>
|
||||
Gheric Speiginer <gheric.speiginer@gmail.com>
|
||||
Hristo Deshev <hristo.deshev@telerik.com>
|
||||
Hristo Hristov <hristo.hristov@telerik.com>
|
||||
Jason Zhekov <jason.zhekov@telerik.com>
|
||||
John Bristowe <john.bristowe@telerik.com>
|
||||
Joe D <joed@destefano.homelinux.com>
|
||||
Kamen Velikov <kamen.velikov@telerik.com>
|
||||
Lubomir Blagoev <lubomir.blagoev@telerik.com>
|
||||
Luke Curran <luke@pepper.me>
|
||||
Matt Donovan <unsecurepeax@gmail.com>
|
||||
Martin Bekchiev <martin.bekchiev@telerik.com>
|
||||
Matthew Knight <anarchicknight@gmail.com>
|
||||
Mihail Slavchev <mihail.slavchev@telerik.com>
|
||||
Nathanael Anderson <nathan@master-technology.com>
|
||||
Nedyalko Nikolov <nedyalko.nikolov@telerik.com>
|
||||
Neli Chakarova <neli.chakarova@telerik.com>
|
||||
Panayot Cankov <panayot.cankov@telerik.com>
|
||||
Peter Staev <peter@tangrasoft.com>
|
||||
Plamen Petkov <plamen.petkov@telerik.com>
|
||||
Prayag Verma <prayag.verma@gmail.com>
|
||||
Richard Lai <it.rclai@gmail.com>
|
||||
Rossen Hristov <rossen.hristov@telerik.com>
|
||||
Stanimir Karoserov <stanimir.karoserov@telerik.com>
|
||||
Stefan Dobrev <stefan.dobrev@telerik.com>
|
||||
TJ VanToll <tj.vantoll@telerik.com>
|
||||
Tsvetan Raikov <tsvetan.raikov@telerik.com>
|
||||
Valentin Stoychev <valentin.stoychev@telerik.com>
|
||||
Vasil Chimev <Vasil.Chimev@telerik.com>
|
||||
Vasil Trifonov <vasil.trifonov@telerik.com>
|
||||
Victor Nascimento <victormota15@gmail.com>
|
||||
Vladimir Enchev <vladimir.enchev@telerik.com>
|
||||
Vladimir Mutafov <vladimir.mutafov@progress.com>
|
||||
Wei Zhang <sagamail@gmail.com>
|
||||
Yavor Georgiev <yavor.georgiev@telerik.com>
|
||||
@@ -1,343 +0,0 @@
|
||||
# NativeScript v3.0 Breaking Changes
|
||||
|
||||
## General notes
|
||||
|
||||
We are moving the modules closer to ES6 standard. This introduces few limitations. One of them is modules can no longer export variable, in such cases variables were replaced with get/set functions.
|
||||
|
||||
## TypeScript
|
||||
TypeScript projects need **TypeScript 2.2** or newer to transpile. You also need to reference the **ES6 and DOM libraries**. Add this to your `tsconfig.json`:
|
||||
|
||||
``` json
|
||||
{
|
||||
"compilerOptions": {
|
||||
...
|
||||
"lib": ["es6", "dom"],
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"*": [
|
||||
"./node_modules/tns-core-modules/*",
|
||||
"./node_modules/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Camera
|
||||
The `camera` module is removed. Use `nativescript-camera` plugin instead.
|
||||
|
||||
## Location
|
||||
The `location` module is removed. Use `nativescript-geolocation` plugin instead.
|
||||
|
||||
## Changes in UI Modules
|
||||
|
||||
### Application
|
||||
We are using the following import statement for the code samples in this section
|
||||
``` ts
|
||||
import * as application from "tns-core-modules/application";
|
||||
```
|
||||
|
||||
`application.mainEntry` was removed.
|
||||
|
||||
`application.mainModule` was removed.
|
||||
|
||||
Pass `mainModule` or `mainEntry` to `application.start` method.
|
||||
If you need access to `mainEntry` use:
|
||||
* `application.getMainEntry(): NavigationEntry`
|
||||
|
||||
The string `mainModule` is implicitly converted to `NavigationEntry` and set to `mainEntry`.
|
||||
|
||||
`application.resources` was removed, use get/set methods:
|
||||
* `application.getResources(): any`
|
||||
* `application.setResources(res: any)`
|
||||
|
||||
`application.cssFile` was removed, use get/set methods:
|
||||
* `application.getCssFileName(): string`
|
||||
* `application.setCssFileName(file: string)`
|
||||
|
||||
Removed application callback methods:
|
||||
* `application.onSuspend()`
|
||||
* `application.onResume()`
|
||||
* `application.onExit()`
|
||||
* `application.onLowMemory()`.
|
||||
|
||||
Use the corresponding events such: `application.on(“suspend”, (args: application.ApplicationEventData) => … );`
|
||||
|
||||
Removed all android specific callback methods. For example instead of `application.android.onActivityResult(…)` use `application.android.on("activityResult", (eventData) => …)`
|
||||
|
||||
### Console
|
||||
`console.dump()` removed, use `console.dir()` instead.
|
||||
|
||||
### KeyframeAnimation
|
||||
Changed method `keyframeAnimationFromInfo(info: KeyframeAnimationInfo, valueSourceModifier: number): KeyframeAnimation` to `KeyframeAnimation.keyframeAnimationFromInfo(info: KeyframeAnimationInfo): KeyframeAnimation`. ValueSource no longer needed.
|
||||
|
||||
### Observable
|
||||
Observable constructor that accepts an object is removed.
|
||||
Use `observableModule.fromObject(obj)` method instead.
|
||||
|
||||
### SegmentedBar
|
||||
Removed method `insertTab()`. You can use `items` property for setting additional tabs.
|
||||
Removed method `getValidIndex()` - it was intended for internal use only.
|
||||
|
||||
The 'items' property is of type `SegmentedBarItem[]`. Items should be created using the `SegmentedBarItem` constructor.
|
||||
|
||||
Old code:
|
||||
``` ts
|
||||
let firstItem = {"title": "first"};
|
||||
segmentedBar.items = [ firstItem ];
|
||||
```
|
||||
New code:
|
||||
``` ts
|
||||
let firstItem = new SegmentedBarItem();
|
||||
firstItem.title = "first";
|
||||
segmentedBar.items = [ firstItem ];
|
||||
```
|
||||
|
||||
### Span
|
||||
Removed methods and properties. These were for internal use only and not needed any more:
|
||||
* `parentFormattedString` property
|
||||
* `updateSpanModifiers(parent: formattedString.FormattedString): void;`
|
||||
* `beginEdit(): void;`
|
||||
* `endEdit(): void;`
|
||||
|
||||
### TabView
|
||||
Removed properties of `TabView` class (`ui/tab-view` module):
|
||||
* `selectedColor` - use `selectedTabTextColor` instead.
|
||||
* `tabsBackgroundColor` - use `tabBackgroundColor` instead.
|
||||
* `textTransform` - `textTransform` can be set on the individual `TabViewItem`s instead on the `TabView`
|
||||
|
||||
### TextField & TextView (Android)
|
||||
Setting `text-transform` property on these controls will not change the text inside them. In case you want to transform the text you should do it before setting it to `text` property.
|
||||
|
||||
### Trace
|
||||
The `enabled` exported variable is replaced with getter function: `isEnabled()`. You can still use the `enable()` and `disable()` methods to enable/disable tracing.
|
||||
|
||||
### Utils
|
||||
We are using the following import statement for the code samples in this section
|
||||
```
|
||||
import * as utils from "tns-core-modules/utils/utils";
|
||||
```
|
||||
Removed `utils.parseJSON(source: string)` method – use `JSON.parse()` instead.
|
||||
|
||||
Removed the following functions. These were for internal use only and are not needed any more:
|
||||
* `utils.copyFrom(source: any, target: any)`
|
||||
* `utils.ad.setTextTransform(view, value: string)`
|
||||
* `utils.ad.setWhiteSpace(view, value: string)`
|
||||
* `utils.ad.setTextDecoration(view, value: string)`
|
||||
* `utils.ad.getTransformedString(textTransform: string, view, stringToTransform: string): string`
|
||||
* `utils.ios.getTransformedText(view, source: string, transform: string): string`
|
||||
* `utils.ios.setWhiteSpace(view, value: string, parentView?: any)`
|
||||
* `utils.ios.setTextAlignment(view, value: string)`
|
||||
|
||||
### View
|
||||
|
||||
Property `cssClass` removed, use `className` instead.
|
||||
|
||||
The `_createUI()` method is renamed to `createNativeView()`. It should now return a native view instance instead of setting it locally. Read more [here](#view-life-cycle).
|
||||
|
||||
The `_onBindingContextChanged()` method is removed.
|
||||
If you are using this to set the `bindingContext` of an object and that object is extending `ViewBase`, it will automatically have its `bindingContext` set. In case you need to know when `bindingContext` is changed you could add handler to `this.on("bindingContextChange", handlerMethod, this)`.
|
||||
|
||||
VerticalAlignment - `"center"` is removed from Typescript definition files but is still supported through CSS/XML. In code – use `"middle"` instead of center.
|
||||
|
||||
### WebView
|
||||
The `url` property of `WebView` is removed, use `src` instead.
|
||||
|
||||
## Property System
|
||||
The way View properties are defined, stored and applied to native view is completely re-written and this is the area where most of the breaking changes and performance improvements are.
|
||||
|
||||
### Properties Types in Modules 3.0
|
||||
There are several type of Properties in modules 3.0:
|
||||
* `Property` – property defined on `ViewBase` or another view class. These are properties like `id` on `ViewBase` or `text` on `Label`.
|
||||
* `CssProperty` – property defined on `Style` type. These are properties that could be set in CSS.
|
||||
* `InheritedCssProperty `- property defined on `Style` type. These are inheritable CSS properties that could be set in CSS and propagates value on its children. These are properties like `FontSize`, `FontWeight`, `Color`, etc.
|
||||
|
||||
### Events raised when property value change
|
||||
One significant change is that properties before 3.0 were raising two events when a value is changed - `propertyChange` and propertyName + `Change` (like `textChange`). The second event was added at some point to make module compatible with Angular.
|
||||
With 3.0 we removed `propertyChange` event and left only the second event. This was done in order to improve performance of our property system. This also leads to cleaner code (no need to listen for every `propertyChange` and then check the name of the property that raised the event).
|
||||
|
||||
With 3.0 if you want to get notification when some property value change you have to specify the *`propertyName`Change* as eventName to `addEventListener` method (like `textField.addEventListener('textChange'`, handler...)).
|
||||
|
||||
### NativeView property
|
||||
There is a new property `nativeView` in `ViewBase` class. It is recommended to use `nativeView` instead of `ios` and `android` properties. The `ios` and `android` properties are left for compatibility, however all view-lifecycle methods and native property callbacks (explained below) should work with the `nativeView` property.
|
||||
|
||||
### Property Example
|
||||
Here is how to define `text` (view property) and `text-align` (css property) for the text-View
|
||||
|
||||
`my-text-view-common.ts` with cross-platform code
|
||||
|
||||
``` ts
|
||||
import { View, Property, CssProperty, InheritedCssProperty, Style, } from "tns-core-modules/ui/core/view";
|
||||
|
||||
export class MyTextViewCommon extends View {
|
||||
...
|
||||
// Defined property to make typescript happy. Not needed in pure JS.
|
||||
text: string;
|
||||
|
||||
// Css properties are defined on the Style when registered
|
||||
// You can optionally expose the property on the View class also
|
||||
get textAlignment(): TextAlignment {
|
||||
return this.style.textAlignment;
|
||||
}
|
||||
set textAlignment(value: TextAlignment) {
|
||||
this.style.textAlignment = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Define textProperty and register it
|
||||
export const textProperty = new Property<MyTextViewCommon, string>({ name: "text", defaultValue: "" });
|
||||
textProperty.register(MyTextViewCommon);
|
||||
|
||||
// Define and register the "text-align" CSS property
|
||||
export type TextAlignment = "left" | "center" | "right";
|
||||
export const textAlignmentProperty = new InheritedCssProperty<Style, TextAlignment>({
|
||||
name: "textAlignment",
|
||||
cssName: "text-align",
|
||||
valueConverter: TextAlignment.parse
|
||||
});
|
||||
textAlignmentProperty.register(Style);
|
||||
```
|
||||
Every property which type is not string should define `valueConverter`. Even properties that are of type string but allow only some strings (like enums) should define `valueConverter` and either convert from string or throw an exception in case value is not valid.
|
||||
If `equalityComparer` is not defined we use `===` to compare `currentValue` and `newValue`. This will work only for simple property types like `boolean`, `string` and `number`. For other types it is recommended to specify `equalityComparer`.
|
||||
|
||||
In the platform specific implementation use `getDefault` and `setNative` symbols from the property object (ex. `textProperty`), to define how this property is applied to native views.
|
||||
|
||||
`getDefault` method is called just once before the first call to `setNative` so that we know what is the default native value for this property. The value that you return will be passed to `setNative` method when we decide to recycle the native view.
|
||||
Recycling the native view of control is done only if `recycleNativeView` field is set to `true`.
|
||||
|
||||
`my-text-view.android.ts` with android specific implementation:
|
||||
|
||||
``` ts
|
||||
import {
|
||||
MyTextViewCommon, textAlignmentProperty, textProperty, ...
|
||||
} from "./my-text-view-common";
|
||||
|
||||
export class MyTextView extends MyTextViewCommon {
|
||||
...
|
||||
|
||||
// text property
|
||||
[textProperty.getDefault](): string {
|
||||
return '';
|
||||
}
|
||||
[textProperty.setNative](value: string) {
|
||||
this.nativeView.setText(value);
|
||||
}
|
||||
|
||||
// text alignment property
|
||||
[textAlignmentProperty.getDefault](): TextAlignment {
|
||||
let nativeGravity = this.nativeView.getGravity();
|
||||
// Extract the align value based on the native gravity
|
||||
return this.extractAlignmentFromGravity(nativeGravity);
|
||||
}
|
||||
|
||||
[textAlignmentProperty.setNative](value: TextAlignment) {
|
||||
let verticalGravity = this.nativeView.getGravity() & android.view.Gravity.VERTICAL_GRAVITY_MASK;
|
||||
// set the native gravity for the view base on the property value
|
||||
switch (value) {
|
||||
case "left":
|
||||
this.nativeView.setGravity(android.view.Gravity.LEFT | verticalGravity);
|
||||
break;
|
||||
...
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Removed Classes and Methods
|
||||
The way of defining properties using `Styler` class and property handlers are no longer valid.
|
||||
* `"ui/styling/style"` modules:
|
||||
* `Styler` class
|
||||
* `StylePropertyChangedHandler` class
|
||||
* `IgnorePropertyHandler` class
|
||||
* `registerHandler(property: Property, handler: StylePropertyChangedHandler, className?: string)`
|
||||
* `registerNoStylingClass(className);`
|
||||
* `getHandler(property: Property, view: View): StylePropertyChangedHandler;`
|
||||
* `"ui/core/dependency-observable"` module
|
||||
* `Property`
|
||||
* `PropertyEntry`
|
||||
* `DependencyObservable`
|
||||
* `“ui/builder/special-properties”` module removed
|
||||
* `"ui/styling/style-property"` module removed.
|
||||
|
||||
### View Class Hierarchy
|
||||
The class hierarchy prior 3.0 was:
|
||||
``` ts
|
||||
Observable > DependencyObservable > Bindable > ProxyObject > View
|
||||
```
|
||||
In 3.0 the redesign of the property system allowed us to collapse it to:
|
||||
``` ts
|
||||
Observable > ViewBase > View
|
||||
```
|
||||
|
||||
`Bindable`(`“ui/core/bindable”` module), `ProxyObject` (`“ui/core/proxy”` module) and `DependencyObservable` (`"ui/core/dependency-observable"` module) are removed.
|
||||
|
||||
Consider using `View`, `ViewBase` or `Observable` instead.
|
||||
|
||||
### Property Types
|
||||
As a part of the refactoring we have changed the types of many properties. The reasons for the changes:
|
||||
* Make better use of the TypeScript typings.
|
||||
* Support for units (`dip`, `px`, `%`) for properties like `width`, `height`, `margin`.
|
||||
|
||||
Here is a list of view and style properties that have their types changes:
|
||||
|
||||
| class.property | old type | new type |
|
||||
|---|---|---|
|
||||
| Style.width | number | PercentLength |
|
||||
| Style.height | number | PercentLength |
|
||||
| Style.minWidth | number | Length |
|
||||
| Style.minHeight | number | Length |
|
||||
| Style.translateX | number | Length |
|
||||
| Style.translateY | number | Length |
|
||||
| Style.margin | string | string \| PercentLength |
|
||||
| Style.margin[Left/Right/Top/Bottom] | number | PercentLength |
|
||||
| Style.padding | string | string \| Length |
|
||||
| Style.padding[Left/Right/Top/Bottom] | number | Length |
|
||||
| Style.borderWidth | string \| number | string \| PercentLength |
|
||||
| Style.border[Left/Right/Top/Bottom]Width | number | Length |
|
||||
| Style.border[TopLeft/TopRight/BottomLeft/BottomRight]Radius | number | Length |
|
||||
| ListView.rowHeight | number | Length |
|
||||
|
||||
Many of the `Style` properties are also defined on the `View` class - the changes in the types are the same.
|
||||
|
||||
Note: The new types are backwards compatible when it comes to setters. For example:
|
||||
``` ts
|
||||
let image = new Image();
|
||||
// still works - sets the width in dips
|
||||
image.width = 100;
|
||||
|
||||
// with 3.0 - sets width in pixels
|
||||
image.width = { value: 100, unit: "px" };
|
||||
```
|
||||
|
||||
You have to be careful when getting the value - you might get a complex object instead of `number`.
|
||||
|
||||
### Enumerations
|
||||
Enumeration from `ui/enums` modules are not used anymore. Most of the properties that accepts specific strings are defined directly with the allowed values:
|
||||
`export type TextAlignment = "initial" | "left" | "center" | "right";`
|
||||
TypeScript will warn in case you set invalid value.
|
||||
|
||||
### View Life-cycle
|
||||
|
||||
With 3.0 we are introducing nativeView recycling. With nativeView recycling we aim to reduce instantiation of native views which is really expensive operation in Android. In order to be able to recycle it, we need all properties exposed from the `View` to be of our new property system.
|
||||
|
||||
In short, we have method that gets the default value for a property which is get the first time a property value is changed. Once we know that our `View` is not needed anymore we will reset the native view to its original state and put it in a map where some future `View`s of the same type could reuse it.
|
||||
There are 3 new important methods:
|
||||
* `createNativeView(): Object;` - method to create and return the native view instance.
|
||||
* `initNativeView(): void;` - method to initialize the native view. Attach handlers, owner, etc.
|
||||
* `disposeNativeView(): void;` - method to detach owner and eventually to reset manually the native view.
|
||||
|
||||
### Iterating Over View Children
|
||||
There are two methods that allow you to traverse view-hierarchy:
|
||||
|
||||
For getting `View` children use:
|
||||
``` ts
|
||||
public eachChildView(callback: (child: View) => boolean): void
|
||||
```
|
||||
|
||||
This method was previously known as `_eachChildView()`. It will return `View` descendants only. For example `TabView` returns the view of each `TabViewItem` because is `TabViewItem` is of type `ViewBase`.
|
||||
|
||||
Getting `ViewBase` children use:
|
||||
``` ts
|
||||
public eachChild(callback: (child: ViewBase) => boolean): void;
|
||||
```
|
||||
This method will return all views including `ViewBase`. It is used by the property system to apply native setters, propagate inherited properties, apply styles, etc.
|
||||
In the case of `TabView` – this method will return `TabViewItem`s as well so that they could be styled through CSS.
|
||||
129
README.md
@@ -1,84 +1,99 @@
|
||||
# NativeScript [](https://travis-ci.org/NativeScript/NativeScript)
|
||||
<img src="https://raw.githubusercontent.com/nstudio/nativescript/master/tools/graphics/nativescript-v8-logo-cropped.png?token=AADPTY7GXDQOQZXOMXRAWIC6YGI4A" width="100" />
|
||||
|
||||

|
||||
# NativeScript
|
||||
|
||||
[NativeScript](http://www.nativescript.org) is a framework for building native iOS and Android apps using JavaScript and CSS. NativeScript renders UIs with the native platform’s rendering engine, no [WebViews](http://developer.telerik.com/featured/what-is-a-webview/), resulting in native-like performance and UX.
|
||||
TypeScript driven development for native platform api's.
|
||||
|
||||
NativeScript provides a best-of-both-worlds development experience. Our cross-platform JavaScript modules give you the convenience of writing iOS and Android apps from a single JavaScript codebase, while our runtimes give you the power of accessing native APIs, SDKs, and frameworks when you need all of them without having to open Xcode or Android Studio. NativeScript was created and is supported by [Telerik](http://www.telerik.com/).
|
||||
# Develop
|
||||
|
||||
Check out the links below to get started:
|
||||
```
|
||||
npm run setup
|
||||
```
|
||||
|
||||
* [CTO’s guide to NativeScript](#for-ctos)
|
||||
* [Getting Started and Installation](#getting-started-and-installation)
|
||||
* [Quick Links](#quick-links)
|
||||
* [Repositories](#repositories)
|
||||
* [Contributing](#contributing)
|
||||
* [Angular](#angular)
|
||||
# Packages
|
||||
|
||||
> **IMPORTANT**: NativeScript is an inclusive community, and we expect all NativeScript community members, users, and contributors to treat each other respectfully. As such, all users of this repository must adhere to the [NativeScript community code of conduct](https://github.com/NativeScript/codeofconduct).
|
||||
* [@nativescript/angular]()
|
||||
* [How to contribute]()
|
||||
* [@nativescript/core]()
|
||||
* [How to contribute]()
|
||||
* [@nativescript/types]()
|
||||
* Types for both iOS/Android below wrapped up as a convenience. *Most commonly used.*
|
||||
* [@nativescript/types-ios]()
|
||||
* Types for iOS
|
||||
* [@nativescript/types-android]()
|
||||
* Types for Android
|
||||
* [@nativescript/ui-mobile-base]()
|
||||
* Base level native ui classes
|
||||
* [How to contribute]()
|
||||
* [@nativescript/webpack]()
|
||||
* [How to contribute]()
|
||||
|
||||
## For CTOs
|
||||
## @nativescript/core
|
||||
|
||||
Making the right technology choices is the key to success. Our [CTO’s guide to NativeScript](https://www.nativescript.org/ctos-guide) helps you understand why NativeScript is the right choice for your next mobile project.
|
||||
```
|
||||
npx apps:playground:ios
|
||||
npm run apps:playground:android
|
||||
|
||||
## Getting Started and Installation
|
||||
|
||||
Our Getting Started Guides are hands-on tutorials that walk you through installing NativeScript and building a real iOS and Android application.
|
||||
npm run packages:core:build
|
||||
npm run packages:core:test
|
||||
|
||||
* [Get started with JavaScript](http://docs.nativescript.org/tutorial/chapter-0)
|
||||
* [Get started with TypeScript and Angular](http://docs.nativescript.org/angular/tutorial/ng-chapter-0)
|
||||
|
||||
## NativeScript architecture diagram
|
||||
|
||||
Below is a common NativeScript architecture diagram. In more detail, read the [How NativeScript Works article](https://docs.nativescript.org/start/how-it-works).
|
||||
|
||||

|
||||
// livesync develop changes
|
||||
nx run core-e2e-playground:ios
|
||||
nx run core-e2e-playground:android
|
||||
|
||||
## Quick Links
|
||||
// clean and reset
|
||||
nx run core-e2e-playground:clean
|
||||
|
||||
- [NativeScript home page](https://nativescript.org)
|
||||
- [NativeScript code samples](https://market.nativescript.org/?tab=samples&framework=all_frameworks&category=all_samples)
|
||||
- [Install NativeScript demo mobile app](https://www.nativescript.org/nativescript-example-application)
|
||||
- [NativeScript playground](https://play.nativescript.org)
|
||||
- [NativeScript and Angular](https://play.nativescript.org/?template=play-ng&tutorial=getting-started-ng)
|
||||
- [@NativeScript on Twitter](http://twitter.com/NativeScript)
|
||||
- [NativeScript community Slack channel](https://www.nativescript.org/slack-invitation-form)
|
||||
- [NativeScript on Stack Overflow](http://stackoverflow.com/questions/tagged/nativescript)
|
||||
- [NativeScript documentation](https://docs.nativescript.org/)
|
||||
- [NativeScript marketplace](https://market.nativescript.org/)
|
||||
- [NativeScript roadmap](https://www.nativescript.org/roadmap)
|
||||
// unit tests
|
||||
nx run core:unit
|
||||
nx run core:unit.watch
|
||||
|
||||
## Repositories
|
||||
// build/prepare for npm (output: 'dist/packages/core')
|
||||
nx run core:build.npm
|
||||
```
|
||||
|
||||
The NativeScript framework consists of a number of components, all of which are open source and on GitHub. Here are the major ones:
|
||||
There are additional targets you can test changes against:
|
||||
|
||||
- **[Cross-platform modules](//github.com/NativeScript/NativeScript/)**
|
||||
[](https://www.npmjs.com/package/tns-core-modules)
|
||||
- This repo contains the [NativeScript cross-platform modules](http://docs.nativescript.org/core-concepts/modules), which abstract iOS and Android APIs into JavaScript APIs—e.g. `camera.takePicture()`. The modules are written in TypeScript.
|
||||
- **[iOS runtime](//github.com/NativeScript/ios-runtime/)**
|
||||
[](https://www.npmjs.com/package/tns-ios)
|
||||
- This repo contains the NativeScript iOS runtime—the code that hosts NativeScript iOS apps, and allows JavaScript code to be executed on iOS devices. The iOS runtime is written in a fun mix of C++, Objective-C, and more.
|
||||
- **[Android runtime](//github.com/NativeScript/android-runtime)**
|
||||
[](https://www.npmjs.com/package/tns-android)
|
||||
- This repo contains the NativeScript Android—the code that hosts NativeScript Android apps, and allows JavaScript code to be executed on Android devices. The Android runtime is written in a fun mix of C++ and Java.
|
||||
- **[CLI](//github.com/NativeScript/nativescript-cli)**
|
||||
[](https://www.npmjs.com/package/nativescript)
|
||||
- This repo contains the NativeScript command-line interface, which lets you create, build, and run apps using the NativeScript framework. The CLI is written in TypeScript.
|
||||
- **[Docs](//github.com/NativeScript/docs)** [](https://docs.nativescript.org/)
|
||||
- This repo contains the NativeScript framework documentation, which is available at <http://docs.nativescript.org/>. The docs are written in Markdown.
|
||||
```
|
||||
// variety of manual ui testing
|
||||
nx run core-e2e-ui:ios
|
||||
nx run core-e2e-ui:android
|
||||
nx run core-e2e-ui:clean
|
||||
|
||||
In addition to the code that makes up the NativeScript framework itself, we also provide a number of [open-source sample apps](https://www.nativescript.org/app-samples-with-code) that you can reference while building your NativeScript application.
|
||||
// used in CI automated tests but you can run these manually as well to check if you caused any regressions
|
||||
nx run core-e2e-automated:ios
|
||||
nx run core-e2e-automated:android
|
||||
nx run core-e2e-automated:clean
|
||||
|
||||
## Contributing
|
||||
|
||||
We love PRs, and accept them for all of our repositories — even docs! Please follow our [contribution guide](https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md) if you want to become part of the project.
|
||||
```
|
||||
|
||||
## Angular
|
||||
#### Compatibility package for old style tns-core-modules
|
||||
|
||||
We [worked together with the Google Angular team](https://angularjs.blogspot.com/2015/12/building-mobile-apps-with-angular-2-and.html) to make Angular 2+ work on top of NativeScript. To use Angular with NativeScript please follow the [getting started](http://docs.nativescript.org/angular/tutorial/ng-chapter-0) article.
|
||||
```
|
||||
nx run tns-core-modules-compat:build
|
||||
```
|
||||
|
||||
## Get Help
|
||||
## @nativescript/ui-mobile-base
|
||||
|
||||
Please, use [github issues](https://github.com/NativeScript/NativeScript/issues) strictly for [reporting a bugs](https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md#bugs) or [requesting features](https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md#features). For general NativeScript questions and support, check out [Stack Overflow](https://stackoverflow.com/questions/tagged/nativescript) or ask our experts in [NativeScript community Slack channel](https://www.nativescript.org/slack-invitation-form).
|
||||
Base native classes for ui components.
|
||||
Included with @nativescript/core right now as direct dependency but also published separately for others to build on top of if desired.
|
||||
|
||||

|
||||
If you would like to make changes to source just build when ready to test your changes (you can then clean any testing target to try your changes)
|
||||
```
|
||||
nx run ui-mobile-base:build
|
||||
```
|
||||
|
||||
## @nativescript/webpack
|
||||
|
||||
```
|
||||
// To try any webpack changes, just build and then clean targets to try
|
||||
nx run webpack:build
|
||||
|
||||
// unit tests
|
||||
nx run webpack:test
|
||||
```
|
||||
|
||||
49
apps/.vscode/launch.json
vendored
@@ -1,49 +0,0 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch on iOS",
|
||||
"type": "nativescript",
|
||||
"request": "launch",
|
||||
"platform": "ios",
|
||||
"appRoot": "${workspaceRoot}",
|
||||
"sourceMaps": true,
|
||||
"watch": true,
|
||||
"stopOnEntry": true,
|
||||
"tnsArgs": [
|
||||
"--sync-all-files"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Attach on iOS",
|
||||
"type": "nativescript",
|
||||
"request": "attach",
|
||||
"platform": "ios",
|
||||
"appRoot": "${workspaceRoot}",
|
||||
"sourceMaps": true,
|
||||
"watch": false
|
||||
},
|
||||
{
|
||||
"name": "Launch on Android",
|
||||
"type": "nativescript",
|
||||
"request": "launch",
|
||||
"platform": "android",
|
||||
"appRoot": "${workspaceRoot}",
|
||||
"sourceMaps": true,
|
||||
"watch": true,
|
||||
"stopOnEntry": true,
|
||||
"tnsArgs": [
|
||||
"--sync-all-files"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Attach on Android",
|
||||
"type": "nativescript",
|
||||
"request": "attach",
|
||||
"platform": "android",
|
||||
"appRoot": "${workspaceRoot}",
|
||||
"sourceMaps": true,
|
||||
"watch": false
|
||||
}
|
||||
]
|
||||
}
|
||||
10
apps/.vscode/tasks.json
vendored
@@ -1,10 +0,0 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "0.1.0",
|
||||
"command": "tsc",
|
||||
"isShellCommand": true,
|
||||
"args": ["-p", "."],
|
||||
"showOutput": "silent",
|
||||
"problemMatcher": "$tsc"
|
||||
}
|
||||
2
apps/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
## Apps configured for workspace development
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
// Add your native dependencies here:
|
||||
|
||||
// Uncomment to add recyclerview-v7 dependency
|
||||
//dependencies {
|
||||
// implementation 'com.android.support:recyclerview-v7:+'
|
||||
//}
|
||||
|
||||
// If you want to add something to be applied before applying plugins' include.gradle files
|
||||
// e.g. project.ext.googlePlayServicesVersion = "15.0.1"
|
||||
// create a file named before-plugins.gradle in the current directory and place it there
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
minSdkVersion 17
|
||||
generatedDensities = []
|
||||
}
|
||||
aaptOptions {
|
||||
additionalParameters "--no-version-vectors"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,212 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "2688h",
|
||||
"filename" : "Default-Portrait-XS-Max.png",
|
||||
"minimum-system-version" : "12.0",
|
||||
"orientation" : "portrait",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "2688h",
|
||||
"filename" : "Default-Landscape-XS-Max.png",
|
||||
"minimum-system-version" : "12.0",
|
||||
"orientation" : "landscape",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "1792h",
|
||||
"filename" : "Default-Portrait-XR.png",
|
||||
"minimum-system-version" : "12.0",
|
||||
"orientation" : "portrait",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "1792h",
|
||||
"filename" : "Default-Landscape-XR.png",
|
||||
"minimum-system-version" : "12.0",
|
||||
"orientation" : "landscape",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "2436h",
|
||||
"filename" : "Default-1125h.png",
|
||||
"minimum-system-version" : "11.0",
|
||||
"orientation" : "portrait",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"extent" : "full-screen",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "2436h",
|
||||
"filename" : "Default-Landscape-X.png",
|
||||
"minimum-system-version" : "11.0",
|
||||
"orientation" : "landscape",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 160 KiB |
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 180 KiB |
|
Before Width: | Height: | Size: 165 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 187 KiB |
|
Before Width: | Height: | Size: 198 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 61 KiB |
@@ -1,47 +0,0 @@
|
||||
<?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>
|
||||
|
Before Width: | Height: | Size: 669 B |
@@ -1,7 +0,0 @@
|
||||
// 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;
|
||||
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
@@ -1 +0,0 @@
|
||||
/* Just here to avoid startup warnings */
|
||||
@@ -1,13 +0,0 @@
|
||||
import * as application from "tns-core-modules/application";
|
||||
declare var CACurrentMediaTime;
|
||||
|
||||
(<any>global).time = function(): number {
|
||||
if (global.android) {
|
||||
return java.lang.System.nanoTime() / 1000000; // 1 ms = 1000000 ns
|
||||
}
|
||||
else {
|
||||
return CACurrentMediaTime() * 1000;
|
||||
}
|
||||
}
|
||||
|
||||
application.start({ moduleName: "css-perf-test/root" });
|
||||
@@ -1,29 +0,0 @@
|
||||
.title {
|
||||
font-size: 20;
|
||||
margin: 3;
|
||||
}
|
||||
|
||||
.author {
|
||||
font-size: 14;
|
||||
horizontal-align: left;
|
||||
vertical-align: bottom;
|
||||
margin: 3;
|
||||
}
|
||||
|
||||
.comments {
|
||||
color: #10C2B0;
|
||||
font-size: 14;
|
||||
vertical-align: bottom;
|
||||
margin: 3;
|
||||
}
|
||||
|
||||
.thumbnail {
|
||||
width: 72;
|
||||
height: 72;
|
||||
margin: 3;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
TabView {
|
||||
background-color: white;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import { EventData as ObservableEventData } from "tns-core-modules/data/observable";
|
||||
|
||||
export function navigatedTo(args: ObservableEventData) {
|
||||
setTimeout(() => {
|
||||
console.log(`Time: ${(<any>global).time() - (<any>global).startTime} ms`);
|
||||
});
|
||||
}
|
||||
@@ -1,307 +0,0 @@
|
||||
<Page
|
||||
xmlns="http://schemas.nativescript.org/tns.xsd" navigatedTo="navigatedTo">
|
||||
<ScrollView>
|
||||
<StackLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
<GridLayout columns="auto, *, auto" rows="auto, 25">
|
||||
<Image src="~/css-perf-test/res/logo" class="thumbnail" rowSpan="2"/>
|
||||
<Label text="Downloading..." textWrap="true" class="title" col="1" colSpan="2" minHeight="50" />
|
||||
<Label text="author " class="author" col="1" row="1" />
|
||||
<Label text="comments" class="comments" col="2" row="1" />
|
||||
</GridLayout>
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</Page>
|
||||
@@ -1,29 +0,0 @@
|
||||
.title {
|
||||
font-size: 20;
|
||||
margin: 3;
|
||||
}
|
||||
|
||||
.author {
|
||||
font-size: 14;
|
||||
horizontal-align: left;
|
||||
vertical-align: bottom;
|
||||
margin: 3;
|
||||
}
|
||||
|
||||
.comments {
|
||||
color: #10C2B0;
|
||||
font-size: 14;
|
||||
vertical-align: bottom;
|
||||
margin: 3;
|
||||
}
|
||||
|
||||
.thumbnail {
|
||||
width: 72;
|
||||
height: 72;
|
||||
margin: 3;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
TabView {
|
||||
background-color: white;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 26 KiB |
@@ -1,7 +0,0 @@
|
||||
import { Page } from "tns-core-modules/ui/page";
|
||||
|
||||
export function onTap(args: any) {
|
||||
(<any>global).startTime = (<any>global).time();
|
||||
let page = <Page>args.object.page;
|
||||
page.frame.navigate("css-perf-test/main-page");
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
|
||||
<Button text="Start test" tap="onTap" />
|
||||
</Page>
|
||||
@@ -1,13 +0,0 @@
|
||||
.btn1 {
|
||||
background-color: lightgreen;
|
||||
color: coral;
|
||||
font-size: 20;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
background-color: coral;
|
||||
color: lightgreen;
|
||||
font-size: 24;
|
||||
font-family: serif;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
import * as application from "tns-core-modules/application";
|
||||
|
||||
// Needed only for build infrastructure
|
||||
application.setCssFileName("devtools-app/app.css");
|
||||
|
||||
application.start({ moduleName: "devtools-app/main-page" });
|
||||
@@ -1,36 +0,0 @@
|
||||
import * as frame from "tns-core-modules/ui/frame";
|
||||
import { Label } from "tns-core-modules/ui/label";
|
||||
import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
|
||||
// import { DOMNode } from "tns-core-modules/debugger/dom-node";
|
||||
|
||||
export function print(args) {
|
||||
// const node = new DOMNode(frame.topmost());
|
||||
// console.dir(node.toJSON());
|
||||
|
||||
// const btn = args.object.page.getViewById("btn");
|
||||
// btn.ensureDomNode();
|
||||
// console.dir(btn.domNode.getComputedProperties());
|
||||
}
|
||||
|
||||
let i = 0;
|
||||
export function add(args) {
|
||||
const container = args.object.page.getViewById("container");
|
||||
const lbl = new Label();
|
||||
lbl.text = "label " + i++;
|
||||
container.addChild(lbl);
|
||||
}
|
||||
|
||||
export function remove(args) {
|
||||
const container = <StackLayout>args.object.page.getViewById("container");
|
||||
const lbl = container.getChildAt(container.getChildrenCount() - 1);
|
||||
container.removeChild(lbl);
|
||||
}
|
||||
|
||||
export function navigate() {
|
||||
frame.topmost().navigate("gallery-app/main-page");
|
||||
}
|
||||
|
||||
export function change(args) {
|
||||
args.object.text = "hi " + Math.random();
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<Page navigatedTo="print">
|
||||
<GridLayout rows="* * *" columns="* * *">
|
||||
|
||||
<Button id="btn"
|
||||
customProp="custom"
|
||||
text="hi there"
|
||||
fontSize="30"
|
||||
row="1"
|
||||
col="1"
|
||||
color="red"
|
||||
backgroundColor="lightgreen"
|
||||
class="btn"
|
||||
tap="change"/>
|
||||
<Button text="class: btn1" class="btn1" row="1" col="0"/>
|
||||
<Button text="class: btn2" class="btn2" row="1" col="2"/>
|
||||
|
||||
<Button text="add" tap="add" />
|
||||
<Button text="remove" tap="remove" col="2" />
|
||||
|
||||
<Button text="move beach" tap="navigate" col="1" />
|
||||
<StackLayout colSpan="3" row="2" id="container">
|
||||
<TextField hint="hint" text="123" />
|
||||
<TextField hint="hint" text="456" />
|
||||
|
||||
|
||||
</StackLayout>
|
||||
</GridLayout>
|
||||
</Page>
|
||||
@@ -1,3 +0,0 @@
|
||||
Button {
|
||||
background-color: red
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import * as application from "tns-core-modules/application";
|
||||
// trace.addCategories(trace.categories.All);
|
||||
// application.run({ moduleName: "modaltest/page.1" });
|
||||
// application.run({ moduleName: "modaltest/main-page" });
|
||||
|
||||
application.run({ moduleName: "modaltest/modal-tab" });
|
||||
// application.run({ moduleName: "modaltest/textview" });
|
||||
|
||||
// application.start({ moduleName: "modaltest/modal-tab.33" });
|
||||
// application.run({ moduleName: modaltest/modal-frame" });
|
||||
// application.start({ moduleName: "modaltest/page.2" });
|
||||
@@ -1,37 +0,0 @@
|
||||
import {
|
||||
View,
|
||||
EventData
|
||||
} from "tns-core-modules/ui/core/view";
|
||||
|
||||
export function onNavigatingTo(args: EventData) {
|
||||
const page = args.object;
|
||||
console.log("onNavigatingTo");
|
||||
}
|
||||
|
||||
export function navigate(args: EventData) {
|
||||
console.log("navigate");
|
||||
(args.object as View).page.frame.navigate("modaltest/page.1");
|
||||
}
|
||||
|
||||
export function onModalTab(args: EventData) {
|
||||
const view = args.object as View;
|
||||
view.showModal("modaltest/modal-tab", "context", closeModal, false);
|
||||
}
|
||||
|
||||
export function onModalFrame(args: EventData) {
|
||||
const view = args.object as View;
|
||||
view.showModal("modaltest/modal-frame", "context", closeModal, false);
|
||||
}
|
||||
|
||||
export function onTap3(args: EventData) {
|
||||
const page = (args.object as View).page;
|
||||
page.actionBar.titleView.requestLayout();
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
console.log("closeModal Called");
|
||||
}
|
||||
|
||||
export function sync(args: EventData) {
|
||||
global.__onLiveSyncCore();
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
<Frame>
|
||||
<Page backgroundColor="blue" loaded='onNavigatingTo'>
|
||||
<ActionBar>
|
||||
<Label text='MIDDLE TEXT' backgroundColor='green' />
|
||||
</ActionBar> -->
|
||||
<!-- <TabView backgroundColor="green">
|
||||
<TabViewItem title="Item One"> -->
|
||||
<!-- <ScrollView backgroundColor="purple"> -->
|
||||
<StackLayout backgroundColor="orange" verticalAlignment="center">
|
||||
<Button text="LiveSync" tap="sync" />
|
||||
<Button text="Show Modal TabView" tap="onModalTab" />
|
||||
<Button text="Show Modal Frame" tap="onModalFrame" />
|
||||
<Button text="requestLayout for titleView" tap="onTap3" />
|
||||
</StackLayout>
|
||||
<!-- </ScrollView> -->
|
||||
<!-- </TabViewItem>
|
||||
</TabView> -->
|
||||
</Page>
|
||||
</Frame>
|
||||
@@ -1,14 +0,0 @@
|
||||
<Page backgroundColor="pink" codeFile='~/modaltest/page.2' actionBarHidden="true">
|
||||
<Frame>
|
||||
<Page backgroundColor="purple">
|
||||
<ActionBar title=" AAA ">
|
||||
<!-- <ActionBar title="{{ $value, 'Page ' + $value }} "> -->
|
||||
<ActionItem text="close" tap="closeModal" ios.position='right' />
|
||||
</ActionBar>
|
||||
<StackLayout backgroundColor="orange">
|
||||
<Button text="FORWARD" tap="onTap"/>
|
||||
<Button text="BACKWARD" tap="onBack"/>
|
||||
</StackLayout>
|
||||
</Page>
|
||||
</Frame>
|
||||
</Page>
|
||||
@@ -1,12 +0,0 @@
|
||||
<Frame codeFile='~/modaltest/page.2'>
|
||||
<Page backgroundColor="pink">
|
||||
<ActionBar title="{{ $value, 'Page ' + $value }} ">
|
||||
<ActionItem text="close" tap="closeModal" ios.position='right' />
|
||||
</ActionBar>
|
||||
<StackLayout backgroundColor="orange">
|
||||
<Button text="FORWARD" tap="onTap"/>
|
||||
<Button text="BACKWARD" tap="onBack"/>
|
||||
<Button text="showModal" tap="showModal"/>
|
||||
</StackLayout>
|
||||
</Page>
|
||||
</Frame>
|
||||
@@ -1,33 +0,0 @@
|
||||
<Page backgroundColor="blue" actionBarHidden="true" loaded="pageLoaded"
|
||||
codeFile='~/modaltest/modal-tab'>
|
||||
<ActionBar title="Frame in Modal Page">
|
||||
<ActionItem text="close" tap="closeModal" />
|
||||
</ActionBar>
|
||||
<TabView backgroundColor="magenta">
|
||||
<TabViewItem title="Button">
|
||||
<StackLayout verticalAlignment="center" backgroundColor="green" verticalAlignment="bottom" horizontalAlignment="right">
|
||||
<Button text="Close Modal" tap="tap" />
|
||||
<Button text="Show Modal Frame" tap="onModalFrame" />
|
||||
</StackLayout>
|
||||
</TabViewItem>
|
||||
<TabViewItem title="Frame">
|
||||
<ScrollView backgroundColor="cyan">
|
||||
<StackLayout backgroundColor="pink" verticalAlignment="bottom" >
|
||||
<Label text="I'm frame in modal page" />
|
||||
<Label text="Tap the button" />
|
||||
<Button text="TAP" tap="onTap" />
|
||||
<Button text="Do 10 go backs" tap="tenGoBacks" />
|
||||
<Button text="Navigate To Page with Frame" tap="navigateToPageWithFrame" />
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</TabViewItem>
|
||||
<TabViewItem title="Item 3">
|
||||
<ScrollView>
|
||||
<StackLayout verticalAlignment="bottom" horizontalAlignment="right">
|
||||
<Button text="Close Modal" tap="tap" />
|
||||
<Button text="Show Modal Frame" tap="onModalFrame" />
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</TabViewItem>
|
||||
</TabView>
|
||||
</Page>
|
||||
@@ -1,3 +0,0 @@
|
||||
Button {
|
||||
background-color: white
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
import {
|
||||
View,
|
||||
EventData
|
||||
} from "tns-core-modules/ui/core/view";
|
||||
|
||||
const colors = ["red", "orange", "magenta"];
|
||||
let x = 0;
|
||||
|
||||
export function onLoaded(args) {
|
||||
// args.object.backgroundColor = colors[++x % 3];
|
||||
}
|
||||
|
||||
export function onLiveSync() {
|
||||
global.__onLiveSyncCore();
|
||||
}
|
||||
|
||||
export function pageLoaded(args: EventData) {
|
||||
const view = args.object as View;
|
||||
const page = view.page;
|
||||
console.log(`Page loaded: ${page}, isLoaded: ${page.isLoaded}`);
|
||||
console.log(`Frame: ${page.frame}, currentPage: ${page.frame.currentPage}`);
|
||||
}
|
||||
|
||||
export function onTap(args) {
|
||||
const view = args.object as View;
|
||||
const page = view.page;
|
||||
let context = page.bindingContext || 0;
|
||||
page.frame.navigate({
|
||||
moduleName: "modaltest/page.2",
|
||||
bindingContext: ++context,
|
||||
transition: {
|
||||
name: "fade",
|
||||
duration: 1000
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function tenGoBacks(args) {
|
||||
const view = args.object as View;
|
||||
const page = view.page;
|
||||
const frame = page.frame;
|
||||
|
||||
let context = page.bindingContext || 0;
|
||||
let x = 4;
|
||||
while (x--) {
|
||||
frame.navigate({
|
||||
moduleName: "modaltest/page.2",
|
||||
bindingContext: ++context,
|
||||
transition: {
|
||||
name: "fade",
|
||||
duration: 1000
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
x = 4;
|
||||
while (x--) {
|
||||
frame.goBack();
|
||||
}
|
||||
}
|
||||
|
||||
export function closeModal(args: EventData) {
|
||||
(args.object as View).closeModal()
|
||||
}
|
||||
|
||||
export function navigateToFrame(args: EventData) {
|
||||
const view = args.object as View;
|
||||
const page = view.page;
|
||||
const frame = page.frame;
|
||||
frame.navigate("modaltest/modal-frame");
|
||||
}
|
||||
|
||||
export function navigateToPageWithFrame(args: EventData) {
|
||||
const view = args.object as View;
|
||||
const page = view.page;
|
||||
const frame = page.frame;
|
||||
frame.navigate("modaltest/modal-frame.1");
|
||||
}
|
||||
|
||||
export function onModalFrame(args: EventData) {
|
||||
const view = args.object as View;
|
||||
view.showModal("modaltest/modal-frame", "some context", undefined, false);
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
<TabView backgroundColor="red" loaded="onLoaded">
|
||||
<TabViewItem title="Button">
|
||||
<StackLayout backgroundColor="orange"
|
||||
verticalAlignment="bottom"
|
||||
horizontalAlignment="right">
|
||||
<Button text="LIVESYNC" tap="onLiveSync" />
|
||||
<Button text="Close Modal" tap="closeModal" />
|
||||
<Button text="Show Modal Frame" tap="onModalFrame" />
|
||||
<TextView text="text viesw" />
|
||||
<TextField text="text field" />
|
||||
<TextField text="text field" />
|
||||
<Button text="Button" />
|
||||
</StackLayout>
|
||||
</TabViewItem>
|
||||
<TabViewItem title="Frame">
|
||||
<Frame backgroundColor="green">
|
||||
<Page backgroundColor="blue" actionBarHidden="true" loaded="pageLoaded">
|
||||
<Page.actionBar>
|
||||
<ActionBar title="Frame in Modal Page" />
|
||||
<ActionItem text="close" tap="closeModal" />
|
||||
</Page.actionBar>
|
||||
<ScrollView backgroundColor="cyan">
|
||||
<StackLayout backgroundColor="pink" verticalAlignment="bottom" >
|
||||
<Label text="I'm frame in modal page" />
|
||||
<Label text="Tap the button" />
|
||||
<Button text="TAP" tap="onTap" />
|
||||
<Button text="Do 10 go backs" tap="tenGoBacks" />
|
||||
<Button text="Navigate To Page with Frame" tap="navigateToPageWithFrame" />
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</Page>
|
||||
</Frame>
|
||||
</TabViewItem>
|
||||
<TabViewItem title="Item 3">
|
||||
<ScrollView>
|
||||
<StackLayout verticalAlignment="bottom" horizontalAlignment="right">
|
||||
<Button text="Close Modal" tap="closeModal" />
|
||||
<Button text="Show Modal Frame" tap="onModalFrame" />
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</TabViewItem>
|
||||
</TabView>
|
||||
@@ -1,57 +0,0 @@
|
||||
import {
|
||||
View,
|
||||
EventData,
|
||||
ShownModallyData
|
||||
} from "tns-core-modules/ui/core/view";
|
||||
|
||||
var x = 0;
|
||||
|
||||
export function tenGoBacks(args: EventData) {
|
||||
const view = args.object as View;
|
||||
const page = view.page;
|
||||
const frame = page.frame;
|
||||
|
||||
x = 10;
|
||||
while (x--) {
|
||||
console.log(`Can go Back: ${frame.canGoBack()}`);
|
||||
frame.goBack();
|
||||
}
|
||||
}
|
||||
export function onTap(args: EventData) {
|
||||
const view = args.object as View;
|
||||
const page = view.page;
|
||||
let context = page.bindingContext || 0;
|
||||
page.frame.navigate({
|
||||
moduleName: "modaltest/page.2",
|
||||
bindingContext: ++context,
|
||||
transition: {
|
||||
name: "fade",
|
||||
duration: 1000
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function onBack(args: EventData) {
|
||||
const view = args.object as View;
|
||||
const page = view.page;
|
||||
page.frame.goBack();
|
||||
}
|
||||
|
||||
export function closeModal(args: EventData) {
|
||||
(args.object as View).closeModal();
|
||||
}
|
||||
|
||||
let modalContext = 0;
|
||||
export function showModal(args: EventData) {
|
||||
(args.object as View).showModal("modaltest/page.2", ++modalContext, function () {
|
||||
console.log(`Closed Modal: ${(args.object as View).bindingContext}`);
|
||||
});
|
||||
}
|
||||
|
||||
export function showingModally(args: ShownModallyData) {
|
||||
(args.object as View).bindingContext = args.context;
|
||||
}
|
||||
|
||||
export function onLivesync() {
|
||||
global.__onLiveSyncCore();
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<Page backgroundColor="pink" showingModally="showingModally">
|
||||
<ActionBar title="{{ $value + ' page' }} ">
|
||||
<ActionItem text="close" tap="closeModal" ios.position='right' />
|
||||
</ActionBar>
|
||||
<StackLayout backgroundColor="orange">
|
||||
<Button text="{{ $value, Modal Page: $value }}" />
|
||||
<Button text="FORWARD" tap="onTap"/>
|
||||
<Button text="BACKWARD" tap="onBack"/>
|
||||
<Button text="Do 10 go backs" tap="tenGoBacks" />
|
||||
<Button text="Show Modal" tap="showModal"/>
|
||||
<Button text="Close Modal" tap="closeModal"/>
|
||||
<Button text="Livesync" tap="onLivesync"/>
|
||||
</StackLayout>
|
||||
</Page>
|
||||
@@ -1,13 +0,0 @@
|
||||
.btn1 {
|
||||
background-color: lightgreen;
|
||||
color: coral;
|
||||
font-size: 20;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
background-color: coral;
|
||||
color: lightgreen;
|
||||
font-size: 24;
|
||||
font-family: serif;
|
||||
}
|
||||