Skip to content

Commit aa31486

Browse files
author
radeva
authored
Merge pull request #99 from NativeScript/radeva/comply-with-verified
Comply with verified plugin definition
2 parents b3b292b + b8292ff commit aa31486

File tree

209 files changed

+1594
-855
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+1594
-855
lines changed

.gitignore

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
1-
# Output
2-
dist
3-
4-
# Dev dependencies
5-
node_modules
6-
7-
# Source, written in TypeScript so JavaScript is not necessary
8-
nativescript-imagepicker/**/*.js
9-
nativescript-imagepicker/**/*.js.map
10-
11-
# Example platforms
12-
/examples/ExampleImgPick/platforms/
13-
/examples/ExampleImgPick/lib/
14-
/examples/ExampleImgPickNG/platforms/
15-
/examples/ExampleImgPickNG/lib/
16-
/examples/ExampleImgPickNG/**/*.js
17-
/examples/ExampleImgPickNG/**/*.js.map
1+
.vscode
2+
.idea
183
.DS_Store
4+
*.js
5+
*.js.map
6+
*.log
7+
!src/scripts/*.js
8+
!seed-tests/*.js
9+
seed-tests/seed-copy/**/*.*
10+
seed-tests/seed-copy-new-git-repo/**/*.*
11+
demo/app/*.js
12+
!demo/karma.conf.js
13+
!demo/app/tests/*.js
14+
demo/*.d.ts
15+
!demo/references.d.ts
16+
demo/lib
17+
demo/platforms
18+
demo/node_modules
19+
demo-angular/app/*.js
20+
!demo-angular/karma.conf.js
21+
!demo-angular/app/tests/*.js
22+
demo-angular/*.d.ts
23+
!demo-angular/references.d.ts
24+
demo-angular/lib
25+
demo-angular/platforms
26+
demo-angular/node_modules
27+
node_modules
28+
publish/src
29+
publish/package
30+
demo/report/report.html
31+
demo/report/stats.json
32+
demo-angular/report/report.html
33+
demo-angular/report/stats.json

.travis.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
matrix:
2+
include:
3+
- stage: "Lint"
4+
language: node_js
5+
os: linux
6+
node_js: "6"
7+
script: cd src && npm run ci.tslint && cd ../demo && npm run ci.tslint && cd ../demo-angular && npm run ci.tslint
8+
- stage: "WebPack"
9+
os: osx
10+
env:
11+
- Platform="iOS"
12+
osx_image: xcode8.3
13+
language: node_js
14+
node_js: "6"
15+
jdk: oraclejdk8
16+
script: cd demo && npm run build.plugin && npm i && npm run build-ios-bundle && cd ../demo-angular && npm run build.plugin && npm i && npm run build-ios-bundle
17+
- language: android
18+
os: linux
19+
env:
20+
- Platform="Android"
21+
jdk: oraclejdk8
22+
before_install: nvm install 6.10.3
23+
script: cd demo && npm run build.plugin && npm i && npm run build-android-bundle && cd ../demo-angular && npm run build.plugin && npm i && npm run build-android-bundle
24+
- stage: "Build"
25+
env:
26+
- Android="25"
27+
language: android
28+
os: linux
29+
jdk: oraclejdk8
30+
before_install: nvm install 6.10.3
31+
script: cd demo && npm run ci.android.build && cd ../demo-angular && npm run ci.android.build
32+
- os: osx
33+
env:
34+
- iOS="10.3"
35+
- Xcode="8.3"
36+
osx_image: xcode8.3
37+
language: node_js
38+
node_js: "6"
39+
jdk: oraclejdk8
40+
script: cd demo && npm run ci.ios.build && cd ../demo-angular && npm run ci.ios.build
41+
42+
android:
43+
components:
44+
- tools
45+
- platform-tools
46+
- build-tools-25.0.2
47+
- android-25
48+
- extra-android-m2repository
49+
50+
before_cache:
51+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
52+
53+
cache:
54+
directories:
55+
- .nvm
56+
- $HOME/.gradle/caches/
57+
- $HOME/.gradle/wrapper/
58+
59+
install:
60+
- echo no | npm install -g nativescript
61+
- tns usage-reporting disable
62+
- tns error-reporting disable
63+
64+

README.md

Lines changed: 99 additions & 16 deletions
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Add your native dependencies here:
2+
3+
// Uncomment to add recyclerview-v7 dependency
4+
//dependencies {
5+
// compile 'com.android.support:recyclerview-v7:+'
6+
//}
7+
8+
android {
9+
defaultConfig {
10+
generatedDensities = []
11+
applicationId = "org.nativescript.imagepickerdemoangular"
12+
}
13+
aaptOptions {
14+
additionalParameters "--no-version-vectors"
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// You can add custom settings here
22
// for example you can uncomment the following line to force distribution code signing
33
// CODE_SIGN_IDENTITY = iPhone Distribution
4-
// To build for device with XCode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
5-
// DEVELOPMENT_TEAM = YOUR_TEAM_ID;
64
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
75
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;

examples/ExampleImgPickNG/app/app.component.html renamed to demo-angular/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ScrollView>
77
<StackLayout>
88
<GridLayout height="94" columns="94, *" rows="*, *" *ngFor="let item of items">
9-
<Image rowSpan="2" width="94" height="94" [src]="item.thumb"></Image>
9+
<Image rowSpan="2" width="94" height="94" [src]="item"></Image>
1010
<Label col="1" [text]="item.uri"></Label>
1111
<Label col="1" row="1" [text]="item.fileUri"></Label>
1212
</GridLayout>

demo-angular/app/app.component.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { Component, ChangeDetectorRef } from "@angular/core";
2+
import { ListView } from "tns-core-modules/ui/list-view";
3+
import { isAndroid } from "tns-core-modules/platform";
4+
import * as imagepicker from "nativescript-imagepicker";
5+
6+
@Component({
7+
selector: "my-app",
8+
templateUrl: "app.component.html",
9+
})
10+
export class AppComponent {
11+
12+
items = [];
13+
14+
constructor(private _changeDetectionRef: ChangeDetectorRef) {
15+
}
16+
17+
onSelectMultipleTap() {
18+
let context = imagepicker.create({
19+
mode: "multiple"
20+
});
21+
this.startSelection(context);
22+
}
23+
24+
onSelectSingleTap() {
25+
let context = imagepicker.create({
26+
mode: "single"
27+
});
28+
this.startSelection(context);
29+
}
30+
31+
startSelection(context) {
32+
let _that = this;
33+
34+
context
35+
.authorize()
36+
.then(() => {
37+
_that.items = [];
38+
return context.present();
39+
})
40+
.then((selection) => {
41+
console.log("Selection done:");
42+
selection.forEach(function (selected) {
43+
console.log("----------------");
44+
console.log("uri: " + selected.uri);
45+
console.log("fileUri: " + selected.fileUri);
46+
});
47+
_that.items = selection;
48+
_that._changeDetectionRef.detectChanges();
49+
}).catch(function (e) {
50+
console.log(e);
51+
});
52+
}
53+
}

examples/ExampleImgPickNG/app/app.css renamed to demo-angular/app/app.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
@import '~/css/core.light.css';
2-
1+
@import '~/css/core.light.css';
2+
33
button, label, stack-layout {
4-
horizontal-align: center;
4+
horizontal-align: center;
55
}
66

77
button {
File renamed without changes.

examples/ExampleImgPickNG/app/package.json renamed to demo-angular/app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"v8Flags": "--expose_gc"
44
},
55
"main": "main.js",
6-
"name": "tns-template-hello-world-ng",
7-
"version": "3.0.0-rc.1"
6+
"name": "tns-template-hello-world",
7+
"version": "3.1.0"
88
}

demo-angular/app/tests/tests.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// var ImagePicker = require("nativescript-imagepicker").ImagePicker;
2+
// var imagePicker = new ImagePicker();
3+
4+
// describe("greet function", function() {
5+
// it("exists", function() {
6+
// expect(yourPlugin.greet).toBeDefined();
7+
// });
8+
9+
// it("returns a string", function() {
10+
// expect(yourPlugin.greet()).toEqual("Hello, NS");
11+
// });
12+
// });
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+
/*
4+
In case snapshot generation is enabled these modules will get into the bundle but will not be required/evaluated.
5+
The snapshot webpack plugin will add them to the tns-java-classes.js bundle file. This way, they will be evaluated on app start as early as possible.
6+
*/
7+
require("ui/frame");
8+
require("ui/frame/activity");
9+
}
File renamed without changes.

0 commit comments

Comments
 (0)