feat: 优化代码

pull/105/head
kunfei 5 years ago
parent 6fe01e336c
commit 817de1ce89
  1. 4
      app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt

@ -71,12 +71,16 @@ class FontSelectDialog : BaseDialogFragment(),
if (fontPath.isNullOrEmpty()) { if (fontPath.isNullOrEmpty()) {
openFolder() openFolder()
} else { } else {
if (fontPath.isContentPath()) {
val doc = DocumentFile.fromTreeUri(requireContext(), Uri.parse(fontPath)) val doc = DocumentFile.fromTreeUri(requireContext(), Uri.parse(fontPath))
if (doc?.canRead() == true) { if (doc?.canRead() == true) {
getFontFiles(doc) getFontFiles(doc)
} else { } else {
openFolder() openFolder()
} }
} else {
getFontFilesByPermission(fontPath)
}
} }
} }

Loading…
Cancel
Save