Skip to content

Commit

Permalink
The old library this uses is deprecated. This gets us onto the new li…
Browse files Browse the repository at this point in the history
…brary. The new library does not crash when a pdf file is corrupted
  • Loading branch information
Jimmy Miller committed Aug 29, 2016
1 parent 716b7a1 commit 54c60a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 5 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'com.android.tools.build:gradle:2.2.0-beta1'
}
}

Expand All @@ -21,6 +21,9 @@ android {
minSdkVersion 16
targetSdkVersion 23
}
lintOptions {
abortOnError false
}
}

repositories {
Expand All @@ -29,5 +32,5 @@ repositories {

dependencies {
compile 'com.facebook.react:react-native:0.20.+'
compile 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'
compile 'com.github.barteksc:android-pdf-viewer:2.0.2'
}
9 changes: 4 additions & 5 deletions android/src/main/java/com/keyee/pdfview/PDFViewManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
import android.util.Log;
import android.graphics.PointF;

import com.joanzapata.pdfview.PDFView;
import com.joanzapata.pdfview.listener.OnPageChangeListener;
import com.joanzapata.pdfview.listener.OnLoadCompleteListener;
import com.github.barteksc.pdfviewer.PDFView;
import com.github.barteksc.pdfviewer.listener.OnPageChangeListener;
import com.github.barteksc.pdfviewer.listener.OnLoadCompleteListener;


import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
Expand Down Expand Up @@ -70,7 +71,6 @@ private void display(PDFView pdfView, boolean jumpToFirstPage) {
if (assetName != null) {
pdfView.fromAsset(assetName)
.defaultPage(pageNumber)
.swipeVertical(true)
.onPageChange(this)
.onLoad(this)
.load();
Expand All @@ -82,7 +82,6 @@ private void display(PDFView pdfView, boolean jumpToFirstPage) {
.defaultPage(pageNumber)
//.showMinimap(false)
//.enableSwipe(true)
.swipeVertical(true)
.onPageChange(this)
.onLoad(this)
.load();
Expand Down

0 comments on commit 54c60a2

Please sign in to comment.