From fd0296f801d938ba4d96b1bc91e3c0e1aba4f4e5 Mon Sep 17 00:00:00 2001 From: Hardcore Sushi Date: Sun, 6 Mar 2022 21:44:58 +0100 Subject: [PATCH] Update libpdfviewer --- .../sushi/hardcore/droidfs/file_viewers/PdfViewer.kt | 10 ++++++---- app/src/main/res/layout/activity_pdf_viewer.xml | 4 ---- libpdfviewer | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 app/src/main/res/layout/activity_pdf_viewer.xml diff --git a/app/src/main/java/sushi/hardcore/droidfs/file_viewers/PdfViewer.kt b/app/src/main/java/sushi/hardcore/droidfs/file_viewers/PdfViewer.kt index c7cd0f1..73e5af3 100644 --- a/app/src/main/java/sushi/hardcore/droidfs/file_viewers/PdfViewer.kt +++ b/app/src/main/java/sushi/hardcore/droidfs/file_viewers/PdfViewer.kt @@ -3,7 +3,6 @@ package sushi.hardcore.droidfs.file_viewers import android.view.Menu import android.view.MenuItem import org.grapheneos.pdfviewer.PdfViewer -import sushi.hardcore.droidfs.databinding.ActivityPdfViewerBinding import java.io.ByteArrayInputStream import java.io.File @@ -19,11 +18,9 @@ class PdfViewer: FileViewerActivity() { } override fun viewFile() { - pdfViewer = ActivityPdfViewerBinding.inflate(layoutInflater).root + pdfViewer = PdfViewer(this) val fileName = File(filePath).name title = fileName - pdfViewer.activity = this - setContentView(pdfViewer) val fileSize = gocryptfsVolume.getSize(filePath) loadWholeFile(filePath, fileSize)?.let { pdfViewer.loadPdf(ByteArrayInputStream(it), fileName, fileSize) @@ -35,6 +32,11 @@ class PdfViewer: FileViewerActivity() { return super.onCreateOptionsMenu(menu) } + override fun onResume() { + super.onResume() + pdfViewer.onResume() + } + override fun onPrepareOptionsMenu(menu: Menu?): Boolean { return pdfViewer.onPrepareOptionsMenu(menu) } diff --git a/app/src/main/res/layout/activity_pdf_viewer.xml b/app/src/main/res/layout/activity_pdf_viewer.xml deleted file mode 100644 index 0c1c3ff..0000000 --- a/app/src/main/res/layout/activity_pdf_viewer.xml +++ /dev/null @@ -1,4 +0,0 @@ - - \ No newline at end of file diff --git a/libpdfviewer b/libpdfviewer index 4e4b7c5..0f31234 160000 --- a/libpdfviewer +++ b/libpdfviewer @@ -1 +1 @@ -Subproject commit 4e4b7c5da4dddbc3841abd450fa250936be70f4e +Subproject commit 0f312347ddcff4aab5edd7d7fdb6837c67584d56