Skip to content
This repository was archived by the owner on Jun 15, 2024. It is now read-only.

Commit 225ad91

Browse files
authored
Merge pull request #5 from Merott/upgrade-ns
Upgrade NativeScript and AndroidPdfViewer
2 parents 864fd6c + 391559f commit 225ad91

9 files changed

+40
-45
lines changed

AndroidPdfViewer.d.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// <reference path="./node_modules/tns-platform-declarations/android17.d.ts" />
1+
/// <reference path="./node_modules/tns-platform-declarations/tns-core-modules/android17.d.ts" />
22

33
declare module com.github.barteksc.pdfviewer {
44
export class PDFView extends android.view.SurfaceView {
@@ -21,6 +21,5 @@ declare class Configurator {
2121
pages(...pageNumbers: number[]): this;
2222
enableDoubletap(enable: boolean): this;
2323
enableSwipe(enable: boolean): this;
24-
showMinimap(show: boolean): this;
25-
swipeVertical(swipe: boolean): this;
24+
swipeHorizontal(horizontal: boolean): this;
2625
}

README.md

+3-10
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@ tns platform add ios
4242
tns run ios
4343

4444
# Android
45-
tns platform add android@2.2.0-next-2016-08-02-918
46-
tns run android # try again if you get error "more than one library ..."
47-
```
48-
49-
## Why the dependency on `android@next` platform
50-
51-
I've been getting all kinds of different issues trying to run this plugin with
52-
the latest released version of `tns-core-modules` and `tns-android` runtime, and
53-
the issues don't appear to exist in the current pre-release versions. Therefore
54-
for the time being I've set the dependencies to pre-release versions.
45+
tns platform add android
46+
tns run android
47+
```

demo/app/package.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
"main": "app.js",
44
"private": true,
55
"dependencies": {
6-
"nativescript-dev-typescript": "^0.3.0",
7-
"tns-core-modules": "^2.1.0"
6+
"nativescript-dev-typescript": "0.3.2",
7+
"tns-core-modules": "2.2.1"
88
},
9-
"devDependencies": {
10-
"babel-traverse": "6.7.6",
11-
"babel-types": "6.7.7",
12-
"babylon": "6.7.0",
13-
"filewalker": "0.1.2",
14-
"lazy": "1.0.11",
15-
"nativescript-dev-typescript": "^0.3.2",
16-
"typescript": "^1.8.10"
17-
}
9+
"devDependencies": {
10+
"babel-traverse": "6.13.0",
11+
"babel-types": "6.13.0",
12+
"babylon": "6.9.0",
13+
"filewalker": "0.1.3",
14+
"lazy": "1.0.11",
15+
"nativescript-dev-typescript": "0.3.2",
16+
"typescript": "^1.8.10"
17+
}
1818
}

demo/package.json

+14-8
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,30 @@
22
"nativescript": {
33
"id": "com.merott.NativeScriptPDFViewDemo",
44
"tns-ios": {
5-
"version": "2.1.1"
5+
"version": "2.2.1"
66
},
77
"tns-android": {
8-
"version": "2.2.0-next-2016-08-02-918"
8+
"version": "2.2.0"
99
}
1010
},
1111
"private": true,
1212
"dependencies": {
13-
"nativescript-pdf-view": "1.0.1",
14-
"tns-core-modules": "2.2.0-2016-08-07-3885"
13+
"nativescript-pdf-view": "latest",
14+
"tns-core-modules": "2.2.1"
1515
},
1616
"devDependencies": {
17-
"babel-traverse": "6.7.6",
18-
"babel-types": "6.7.7",
19-
"babylon": "6.7.0",
20-
"filewalker": "0.1.2",
17+
"babel-traverse": "6.13.0",
18+
"babel-types": "6.13.0",
19+
"babylon": "6.9.0",
20+
"filewalker": "0.1.3",
2121
"lazy": "1.0.11",
2222
"nativescript-dev-typescript": "^0.3.2",
2323
"typescript": "^1.8.10"
24+
},
25+
"scripts": {
26+
"reinstall:ios": "tns platform remove ios && tns platform add ios && tns plugin add ..",
27+
"reinstall:android": "tns platform remove android && tns platform add android && tns plugin add ..",
28+
"android": "tns run android",
29+
"ios": "tns run ios"
2430
}
2531
}

package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
"main": "src/plugin.js",
55
"nativescript": {
66
"platforms": {
7-
"android": "2.2.0-next-2016-08-02-918",
8-
"ios": "2.1.1"
7+
"android": "2.2.0",
8+
"ios": "2.2.1"
99
}
1010
},
1111
"scripts": {
1212
"build": "tsc",
13+
"build:watch": "tsc --watch",
1314
"demo.ios": "npm run preparedemo && cd demo && tns emulate ios",
1415
"demo.android": "npm run preparedemo && cd demo && tns run android",
1516
"preparedemo": "npm run build && cd demo && tns plugin remove nativescript-pdf-view && tns plugin add .. && tns install",
@@ -48,9 +49,9 @@
4849
"@semantic-release/condition-codeship": "1.1.0",
4950
"@semantic-release/release-notes-generator": "2.0.0",
5051
"semantic-release": "4.3.5",
51-
"tns-core-modules": "2.2.0-2016-08-07-3885",
52-
"tns-platform-declarations": "2.0.0",
53-
"tslint": "3.13.0",
52+
"tns-core-modules": "2.2.1",
53+
"tns-platform-declarations": "2.2.0",
54+
"tslint": "3.14.0",
5455
"typescript": "1.8.10"
5556
}
5657
}

platforms/android/include.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ android {
77
}
88

99
dependencies {
10-
compile 'com.github.barteksc:android-pdf-viewer:1.1.2'
10+
compile 'com.github.barteksc:android-pdf-viewer:2.0.1'
1111
}

src/plugin.android.ts

-4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ export class PDFView extends common.PDFView {
3636

3737
this.android
3838
.fromUri(uri)
39-
.enableSwipe(true)
40-
.enableDoubletap(true)
41-
.swipeVertical(true)
42-
.showMinimap(false)
4339
.load();
4440
}
4541

src/plugin.ios.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class PDFView extends common.PDFView {
3737
}
3838

3939
private init() {
40-
this.ios = new UIWebView(CGRectInfinite);
40+
this.ios = new UIWebView(UIScreen.mainScreen().bounds);
4141

4242
this.ios.autoresizingMask =
4343
UIViewAutoresizing.UIViewAutoresizingFlexibleWidth |

tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"sourceMap": true
88
},
99
"files": [
10-
"./node_modules/tns-platform-declarations/android17.d.ts",
11-
"./node_modules/tns-platform-declarations/ios.d.ts",
10+
"./node_modules/tns-platform-declarations/tns-core-modules/android17.d.ts",
11+
"./node_modules/tns-platform-declarations/tns-core-modules/ios.d.ts",
1212
"./node_modules/tns-core-modules/tns-core-modules.d.ts",
1313
"src/plugin.common.ts",
1414
"src/plugin.android.ts",

0 commit comments

Comments
 (0)