From 817de1ce897e99f47280c06bc9c8f630c99c68f2 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 19 Feb 2020 11:22:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/widget/font/FontSelectDialog.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt b/app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt index e3162860c..be5523b58 100644 --- a/app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt +++ b/app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt @@ -71,11 +71,15 @@ class FontSelectDialog : BaseDialogFragment(), if (fontPath.isNullOrEmpty()) { openFolder() } else { - val doc = DocumentFile.fromTreeUri(requireContext(), Uri.parse(fontPath)) - if (doc?.canRead() == true) { - getFontFiles(doc) + if (fontPath.isContentPath()) { + val doc = DocumentFile.fromTreeUri(requireContext(), Uri.parse(fontPath)) + if (doc?.canRead() == true) { + getFontFiles(doc) + } else { + openFolder() + } } else { - openFolder() + getFontFilesByPermission(fontPath) } } }