feat: 优化代码

pull/105/head
kunfei 5 years ago
parent 6fe01e336c
commit 817de1ce89
  1. 12
      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)
}
}
}

Loading…
Cancel
Save