feat: 优化代码

pull/105/head
kunfei 5 years ago
parent d460a5ede3
commit e4d572f0cf
  1. 3
      app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt

@ -110,7 +110,8 @@ class FontSelectDialog : BaseDialogFragment(),
@SuppressLint("DefaultLocale") @SuppressLint("DefaultLocale")
private fun getFontFiles(uri: Uri) { private fun getFontFiles(uri: Uri) {
launch(IO) { launch(IO) {
val docItems = DocumentUtils.listFiles(App.INSTANCE, uri) val doc = DocumentFile.fromTreeUri(App.INSTANCE, uri) ?: return@launch
val docItems = DocumentUtils.listFiles(App.INSTANCE, doc.uri)
fontCacheFolder.listFiles()?.forEach { fontFile -> fontCacheFolder.listFiles()?.forEach { fontFile ->
var contain = false var contain = false
for (item in docItems) { for (item in docItems) {

Loading…
Cancel
Save