Browse Source

Update libpdfviewer

master
Hardcore Sushi 4 months ago
parent
commit
fd0296f801
Signed by: hardcoresushi
GPG Key ID: AFE384344A45E13A
  1. 10
      app/src/main/java/sushi/hardcore/droidfs/file_viewers/PdfViewer.kt
  2. 4
      app/src/main/res/layout/activity_pdf_viewer.xml
  3. 2
      libpdfviewer

10
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)
}

4
app/src/main/res/layout/activity_pdf_viewer.xml

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<org.grapheneos.pdfviewer.PdfViewer xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

2
libpdfviewer

@ -1 +1 @@
Subproject commit 4e4b7c5da4dddbc3841abd450fa250936be70f4e
Subproject commit 0f312347ddcff4aab5edd7d7fdb6837c67584d56
Loading…
Cancel
Save