pull/83/head
kunfei 5 years ago
parent 427eac4313
commit 0aafde21e4
  1. 8
      app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt

@ -87,9 +87,13 @@ class ImportBookActivity : VMBaseActivity<ImportBookViewModel>(R.layout.activity
tv_path.text = tv_path.text.toString() + it.name + File.separator tv_path.text = tv_path.text.toString() + it.name + File.separator
} }
} }
doc?.listFiles()?.let { val docList = arrayListOf<DocumentFile>()
importBookAdapter.setItems(it.toList()) doc?.listFiles()?.forEach {
if (it.isDirectory || it.name?.endsWith(".txt", true) == true) {
docList.add(it)
}
} }
importBookAdapter.setItems(docList)
} }
} }

Loading…
Cancel
Save