From 8ea40e14578be3497010171ee75411da628c8dbb Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 3 Jan 2023 11:49:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/book/BookHelp.kt | 2 +- app/src/main/java/io/legado/app/model/localBook/PdfFile.kt | 2 +- .../java/io/legado/app/ui/book/read/page/ContentTextView.kt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/book/BookHelp.kt b/app/src/main/java/io/legado/app/help/book/BookHelp.kt index 3979c2117..918daedba 100644 --- a/app/src/main/java/io/legado/app/help/book/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/book/BookHelp.kt @@ -211,7 +211,7 @@ object BookHelp { return if (uri.isContentScheme()) { appCtx.contentResolver.openFileDescriptor(uri, "r") } else { - ParcelFileDescriptor.open(File(uri.path), ParcelFileDescriptor.MODE_READ_ONLY) + ParcelFileDescriptor.open(File(uri.path!!), ParcelFileDescriptor.MODE_READ_ONLY) } } diff --git a/app/src/main/java/io/legado/app/model/localBook/PdfFile.kt b/app/src/main/java/io/legado/app/model/localBook/PdfFile.kt index 029e977b0..6b44617dd 100644 --- a/app/src/main/java/io/legado/app/model/localBook/PdfFile.kt +++ b/app/src/main/java/io/legado/app/model/localBook/PdfFile.kt @@ -107,7 +107,7 @@ class PdfFile(var book: Book) { } } else { fileDescriptor = - ParcelFileDescriptor.open(File(uri.path), ParcelFileDescriptor.MODE_READ_ONLY) + ParcelFileDescriptor.open(File(uri.path!!), ParcelFileDescriptor.MODE_READ_ONLY) ?.also { pdfRenderer = PdfRenderer(it) } diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt index f33b1ff2e..46dc2dacd 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt @@ -308,6 +308,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at * 单击 * @return true:已处理, false:未处理 */ + @Suppress("UNUSED_ANONYMOUS_PARAMETER") fun click(x: Float, y: Float): Boolean { var handled = false touch(x, y) { _, textPos, textPage, textLine, column ->