File tree Expand file tree Collapse file tree 5 files changed +15
-10
lines changed
src/main/java/com/github/barteksc/pdfviewer Expand file tree Collapse file tree 5 files changed +15
-10
lines changed Original file line number Diff line number Diff line change
1
+ ## 3.0.0-beta.3 (2017-11-18)
2
+ * Fix bug preventing ` OnErrorListener ` from being called
3
+
1
4
## 3.0.0-beta.2 (2017-11-15)
2
5
* Fix rendering with maximum zoom
3
6
* Improve fit policies
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ Licensed under Apache License 2.0.
18
18
19
19
3.0.0-beta.2 fixes rendering with maximum zoom, improves fit policies and updates PdfiumAndroid to 1.8.1
20
20
21
+ 3.0.0-beta.3 fixes bug preventing ` OnErrorListener ` from being called
22
+
21
23
## Changes in 3.0 API
22
24
* Replaced ` Contants.PRELOAD_COUNT ` with ` PRELOAD_OFFSET `
23
25
* Removed ` PDFView#fitToWidth() ` (variant without arguments)
@@ -29,7 +31,7 @@ Licensed under Apache License 2.0.
29
31
30
32
Add to _ build.gradle_ :
31
33
32
- ` compile 'com.github.barteksc:android-pdf-viewer:3.0.0-beta.2 ' `
34
+ ` compile 'com.github.barteksc:android-pdf-viewer:3.0.0-beta.3 ' `
33
35
34
36
or if you want to use more stable version:
35
37
Original file line number Diff line number Diff line change 13
13
siteUrl = ' https://github.com/barteksc/AndroidPdfViewer'
14
14
gitUrl = ' https://github.com/barteksc/AndroidPdfViewer.git'
15
15
16
- libraryVersion = ' 3.0.0-beta.2 '
16
+ libraryVersion = ' 3.0.0-beta.3 '
17
17
18
18
developerId = ' barteksc'
19
19
developerName = ' Bartosz Schiller'
@@ -32,7 +32,7 @@ android {
32
32
minSdkVersion 11
33
33
targetSdkVersion 25
34
34
versionCode 1
35
- versionName " 3.0.0-beta.2 "
35
+ versionName " 3.0.0-beta.3 "
36
36
}
37
37
38
38
}
Original file line number Diff line number Diff line change @@ -692,9 +692,13 @@ void loadComplete(PdfFile pdfFile) {
692
692
693
693
void loadError (Throwable t ) {
694
694
state = State .ERROR ;
695
+ // store reference, because callbacks will be cleared in recycle() method
696
+ OnErrorListener onErrorListener = callbacks .getOnError ();
695
697
recycle ();
696
698
invalidate ();
697
- if (!callbacks .callOnError (t )) {
699
+ if (onErrorListener != null ) {
700
+ onErrorListener .onError (t );
701
+ } else {
698
702
Log .e ("PDFView" , "load pdf error" , t );
699
703
}
700
704
}
Original file line number Diff line number Diff line change @@ -83,12 +83,8 @@ public void setOnError(OnErrorListener onErrorListener) {
83
83
this .onErrorListener = onErrorListener ;
84
84
}
85
85
86
- public boolean callOnError (Throwable error ) {
87
- if (onErrorListener != null ) {
88
- onErrorListener .onError (error );
89
- return true ;
90
- }
91
- return false ;
86
+ public OnErrorListener getOnError () {
87
+ return onErrorListener ;
92
88
}
93
89
94
90
public void setOnPageError (OnPageErrorListener onPageErrorListener ) {
You can’t perform that action at this time.
0 commit comments