Skip to content

Commit 1942ec5

Browse files
committed
changes required for verification
1 parent 8fc5f9b commit 1942ec5

17 files changed

+317
-30
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,7 @@ node_modules
5454
*.tmp.*
5555
platforms
5656
demo/lib
57+
demo-ng/lib
5758
hooks
5859
*.log
60+
report

.travis.yml

Lines changed: 90 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,92 @@
1-
language: node_js
2-
node_js:
3-
6.10.3
4-
before_script:
1+
sudo: false
2+
3+
android:
4+
components:
5+
- tools
6+
- platform-tools
7+
- build-tools-25.0.2
8+
- android-23
9+
- android-25
10+
- extra-android-m2repository
11+
12+
before_cache:
13+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
14+
15+
cache:
16+
directories:
17+
- .nvm
18+
- $HOME/.gradle/caches/
19+
- $HOME/.gradle/wrapper/
20+
21+
install:
22+
- echo no | npm install -g nativescript
23+
- tns usage-reporting disable
24+
- tns error-reporting disable
25+
- echo no | npm install -g grunt-cli
526
- npm install
6-
script:
7-
./node_modules/.bin/grunt build
27+
- grunt compile
28+
29+
matrix:
30+
include:
31+
- stage: lint
32+
language: node_js
33+
os: linux
34+
node_js: "6"
35+
script: grunt lint
36+
37+
- stage: build
38+
language: android
39+
os: linux
40+
env:
41+
- Android="25"
42+
jdk: oraclejdk8
43+
before_install: nvm install 6.10.3
44+
script: "grunt ci:build:android"
45+
46+
- stage: build
47+
os: osx
48+
env:
49+
- iOS="10.3"
50+
- Xcode="8.3"
51+
osx_image: xcode8.3
52+
language: node_js
53+
node_js: "6"
54+
jdk: oraclejdk8
55+
script: "grunt ci:build:ios"
56+
57+
- stage: webpack
58+
language: android
59+
os: linux
60+
env:
61+
- Android="25"
62+
- Platform="Android"
63+
jdk: oraclejdk8
64+
before_install: nvm install 6.10.3
65+
script: "grunt ci:webpack:android"
66+
67+
- stage: webpack
68+
os: osx
69+
env:
70+
- iOS="10.3"
71+
- Xcode="8.3"
72+
- Platform="iOS"
73+
osx_image: xcode8.3
74+
language: node_js
75+
node_js: "6"
76+
jdk: oraclejdk8
77+
script: "grunt ci:webpack:ios"
878

79+
- stage: deploy
80+
if: branch = release
81+
language: node_js
82+
node_js: "6"
83+
before_deploy:
84+
- cd bin/dist
85+
deploy:
86+
provider: npm
87+
88+
api_key:
89+
secure: "DG4qp4h8z3Z+xklcUVkMmlES0bDxkNhXc1MMJeXSnDXRmsWmGFSvnWXGZWJF04fkCQdtIcG6vKanxpTklGKm7IKyaGliG3lwHx9mI5pp/u28A7fbq6DQ5/k72jw4EOAYZ3sAv5J8hy7152f+OEeYiN1hzbmge4t5AXDg+PreF204CuegvuZyqGU+R3s9xvSIzd3AR+M/Kpc+eI5ti1nBqyfKO7N1Q6RUp70qkGmglNecLownHkmaaEvurV47vH98KiK3i6gaVArJX/5iaujmHWGgaSHGHuFMf1X0lVsjmvACI9d5xTeqJyCxc16HLJ+MghlJ0XcEo93T5CZoXMgOoVb5jBkAv1MIXBUmvgi2fpceyuU+OVCLM8McjyZHZiSoFt7yMyEuJvrrfqbQ2jIGb/+XHY0P80EciUnKFO8IYvaXla6olDmY5y9XnivqoJqemidlMC4v+7fv6Pg/JPpxDkFMa2I2JcA4HBnZ3pv60aO962xvHH6m1O32+F/rOhYfiRzY34WlbCZRPMwcRY/ZxjEzdSjUHVd6tClrOCL/LqaCZXkBEKzNpglnvahSJaKyXTDzXMeWRuvYSTgrttu97FiC1CYEl/IhctS8EQE1rpGHt8DjYiOd54Ypxbrh6ZJ8VBQ26CMsBbil5DDaD9ysfPFOEAQRPuw2KaQcqNvv13k="
90+
skip_cleanup: true
91+
on:
92+
branch: release

README.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Run the following command from the root of your project:
1616

1717
This command automatically installs the necessary files, as well as stores nativescript-image-swipe as a dependency in your project's package.json file.
1818

19-
## Usage
20-
You need to add `xmlns:is="nativescript-image-swipe"` to your page tag, and then simply use `<is:ImageSwipe/>` in order to add the widget to your page.
19+
## Configuration
20+
There is no additional configuration needed!
2121

2222
## API
2323

@@ -45,8 +45,11 @@ Gets or sets the currently visible image.
4545
* **imageUrlProperty** - *string*
4646
Gets or sets the property inside the items' object that defines the Url from where to load the images
4747

48+
* **allowZoom** - *boolean (default: true)*
49+
Gets or sets whether zoom is enabled
4850

49-
## Example
51+
## Usage
52+
You need to add `xmlns:is="nativescript-image-swipe"` to your page tag, and then simply use `<is:ImageSwipe/>` in order to add the widget to your page.
5053
```xml
5154
<!-- test-page.xml -->
5255
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:is="nativescript-image-swipe" navigatingTo="navigatingTo">
@@ -90,7 +93,9 @@ export function pageChanged(e: PageChangeEventData) {
9093
}
9194
```
9295

93-
## Angular Example
96+
## Usage in Angular
97+
In order to use the `ImageSwipe` you must register it in **BOTH** your `main.ts` and `main.aot.ts`!
98+
9499
```typescript
95100
// main.ts
96101
import { platformNativeScriptDynamic } from "nativescript-angular/platform";
@@ -163,4 +168,21 @@ module.exports = function (platform, destinationApp) {
163168
}
164169
//......
165170
}
166-
```
171+
```
172+
173+
## Demos
174+
This repository includes both Angular and plain NativeScript demos. In order to run those execute the following in your shell:
175+
```shell
176+
$ git clone https://github.com/peterstaev/nativescript-image-swipe
177+
$ cd nativescript-image-swipe
178+
$ npm install
179+
$ npm run demo-ios
180+
```
181+
This will run the plain NativeScript demo project on iOS. If you want to run it on Android simply use the `-android` instead of the `-ios` sufix.
182+
183+
If you want to run the Angular demo simply use the `demo-ng-` prefix instead of `demo-`.
184+
185+
## Donate
186+
`bitcoin:14fjysmpwLvSsAskvLASw6ek5XfhTzskHC`
187+
188+
![Donate](https://www.tangrainc.com/qr.png)

demo-ng/app/main.aot.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// this import should be first in order to load some required settings (like globals and reflect-metadata)
22
import { platformNativeScript } from "nativescript-angular/platform-static";
3+
import { registerElement } from "nativescript-angular/element-registry";
34

45
import { AppModuleNgFactory } from "./app.module.ngfactory";
56

7+
registerElement("ImageSwipe", () => require("nativescript-image-swipe/image-swipe").ImageSwipe);
8+
69
platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require("application");
2+
if (!global["__snapshot"]) {
3+
// In case snapshot generation is enabled these modules will get into the bundle
4+
// but will not be required/evaluated.
5+
// The snapshot webpack plugin will add them to the tns-java-classes.js bundle file.
6+
// This way, they will be evaluated on app start as early as possible.
7+
require("ui/frame");
8+
require("ui/frame/activity");
9+
}

demo-ng/app/vendor-platform.ios.ts

Whitespace-only changes.

demo-ng/app/vendor.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require("./vendor-platform");
2+
3+
require("reflect-metadata");
4+
require("@angular/platform-browser");
5+
require("@angular/core");
6+
require("@angular/common");
7+
require("@angular/forms");
8+
require("@angular/http");
9+
require("@angular/router");
10+
11+
require("nativescript-angular/platform-static");
12+
require("nativescript-angular/forms");
13+
require("nativescript-angular/router");

demo-ng/package.json

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,22 @@
55
"repository": "<fill-your-repository-here>",
66
"nativescript": {
77
"id": "com.tangrainc.imageswipedemong",
8-
"tns-ios": {
9-
"version": "3.0.1"
10-
},
118
"tns-android": {
12-
"version": "3.0.1"
9+
"version": "3.2.0"
10+
},
11+
"tns-ios": {
12+
"version": "3.2.0"
1313
}
1414
},
15+
"scripts": {
16+
"ns-bundle": "ns-bundle",
17+
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
18+
"generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install",
19+
"start-android-bundle": "npm run ns-bundle --android --run-app",
20+
"start-ios-bundle": "npm run ns-bundle --ios --run-app",
21+
"build-android-bundle": "npm run ns-bundle --android --build-app",
22+
"build-ios-bundle": "npm run ns-bundle --ios --build-app"
23+
},
1524
"dependencies": {
1625
"@angular/animations": "~4.1.0",
1726
"@angular/common": "~4.1.0",
@@ -26,15 +35,27 @@
2635
"nativescript-theme-core": "~1.0.2",
2736
"reflect-metadata": "~0.1.8",
2837
"rxjs": "~5.3.0",
29-
"tns-core-modules": "~3.0.0",
38+
"tns-core-modules": "^3.2.0",
3039
"zone.js": "~0.8.2"
3140
},
3241
"devDependencies": {
42+
"@angular/compiler-cli": "~4.1.0",
43+
"@ngtools/webpack": "~1.6.0",
3344
"babel-traverse": "6.24.1",
3445
"babel-types": "6.24.1",
3546
"babylon": "6.17.0",
47+
"copy-webpack-plugin": "~4.0.1",
48+
"extract-text-webpack-plugin": "~3.0.0",
3649
"lazy": "1.0.11",
50+
"nativescript-css-loader": "~0.26.0",
3751
"nativescript-dev-typescript": "~0.4.5",
38-
"typescript": "~2.2.0"
52+
"nativescript-dev-webpack": "^0.8.0",
53+
"nativescript-worker-loader": "~0.8.1",
54+
"raw-loader": "~0.5.1",
55+
"resolve-url-loader": "~2.1.0",
56+
"typescript": "~2.2.0",
57+
"webpack": "~3.2.0",
58+
"webpack-bundle-analyzer": "^2.8.2",
59+
"webpack-sources": "~1.0.1"
3960
}
4061
}

demo-ng/tsconfig.aot.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"extends": "./tsconfig",
3+
"compilerOptions": {
4+
"baseUrl": ".",
5+
"paths": {
6+
"application": ["node_modules/tns-core-modules/application"],
7+
"application-settings": ["node_modules/tns-core-modules/application-settings"],
8+
"camera": ["node_modules/tns-core-modules/camera"],
9+
"color": ["node_modules/tns-core-modules/color"],
10+
"connectivity": ["node_modules/tns-core-modules/connectivity"],
11+
"console": ["node_modules/tns-core-modules/console"],
12+
"data/*": ["node_modules/tns-core-modules/data/*"],
13+
"fetch": ["node_modules/tns-core-modules/fetch"],
14+
"file-system": ["node_modules/tns-core-modules/file-system"],
15+
"fps-meter": ["node_modules/tns-core-modules/fps-meter"],
16+
"globals": ["node_modules/tns-core-modules/globals"],
17+
"http": ["node_modules/tns-core-modules/http"],
18+
"image-asset": ["node_modules/tns-core-modules/image-asset"],
19+
"image-source": ["node_modules/tns-core-modules/image-source"],
20+
"location": ["node_modules/tns-core-modules/location"],
21+
"platform": ["node_modules/tns-core-modules/platform"],
22+
"text": ["node_modules/tns-core-modules/text"],
23+
"timer": ["node_modules/tns-core-modules/timer"],
24+
"trace": ["node_modules/tns-core-modules/trace"],
25+
"ui/*": ["node_modules/tns-core-modules/ui/*"],
26+
"utils/*": ["node_modules/tns-core-modules/utils/*"],
27+
"xhr": ["node_modules/tns-core-modules/xhr"],
28+
"xml": ["node_modules/tns-core-modules/xml"]
29+
},
30+
"skipLibCheck": true
31+
},
32+
"exclude": [
33+
"node_modules",
34+
"platforms"
35+
],
36+
"angularCompilerOptions": {
37+
"skipMetadataEmit": true,
38+
"genDir": "./"
39+
}
40+
}

demo/.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"**/.hg": true,
77
"**/CVS": true,
88
"**/.DS_Store": true,
9-
"**/platforms": true
9+
"**/platforms": true,
10+
"**/app/**/*.js": true
1011
}
1112
}

0 commit comments

Comments
 (0)