diff --git a/android-pdf-viewer/build.gradle b/android-pdf-viewer/build.gradle index 9f48e95c..59a6da7a 100644 --- a/android-pdf-viewer/build.gradle +++ b/android-pdf-viewer/build.gradle @@ -3,7 +3,7 @@ plugins { id 'maven-publish' } -group "com.github.lion1988dev" +group "com.github.GoIntegro" android { namespace "com.github.barteksc.pdfviewer" @@ -42,15 +42,15 @@ android { dependencies { implementation 'androidx.appcompat:appcompat:1.6.1' - api 'com.github.lion1988dev:PdfiumAndroid:1.9.4' + api 'com.github.GoIntegro:PdfiumAndroid:1.9.5' } publishing { publications { release(MavenPublication) { - groupId = 'com.github.lion1988dev' + groupId = 'com.github.GoIntegro' artifactId = 'AndroidPdfViewer' - version = "3.2.4" + version = "3.2.5" afterEvaluate { from components.release diff --git a/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/PDFView.java b/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/PDFView.java index b8374721..1eac9e4b 100644 --- a/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/PDFView.java +++ b/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/PDFView.java @@ -245,8 +245,6 @@ ScrollHandle getScrollHandle() { public PDFView(Context context, AttributeSet set) { super(context, set); - renderingHandlerThread = new HandlerThread("PDF renderer"); - if (isInEditMode()) { return; } @@ -462,6 +460,14 @@ public void computeScroll() { animationManager.computeFling(); } + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + if (renderingHandlerThread == null) { + renderingHandlerThread = new HandlerThread("PDF renderer"); + } + } + @Override protected void onDetachedFromWindow() { recycle(); @@ -753,6 +759,10 @@ void loadComplete(PdfFile pdfFile) { this.pdfFile = pdfFile; + if (renderingHandlerThread == null) { + renderingHandlerThread = new HandlerThread("PDF renderer"); + } + if (!renderingHandlerThread.isAlive()) { renderingHandlerThread.start(); }