pull/1403/head
gedoor 3 years ago
parent 9753d0c608
commit 8100913489
  1. 11
      app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt

@ -138,13 +138,14 @@ class ImportBookActivity : VMBaseActivity<ActivityImportBookBinding, ImportBookV
lastPath.isContentScheme() -> { lastPath.isContentScheme() -> {
val rootUri = Uri.parse(lastPath) val rootUri = Uri.parse(lastPath)
kotlin.runCatching { kotlin.runCatching {
DocumentFile.fromTreeUri(this, rootUri)?.let { val doc = DocumentFile.fromTreeUri(this, rootUri)
subDocs.clear() if (doc == null || doc.name.isNullOrEmpty()) {
rootDoc = FileDoc.fromDocumentFile(it)
upDocs(rootDoc!!)
} ?: let {
binding.tvEmptyMsg.visible() binding.tvEmptyMsg.visible()
selectFolder.launch(null) selectFolder.launch(null)
} else {
subDocs.clear()
rootDoc = FileDoc.fromDocumentFile(doc)
upDocs(rootDoc!!)
} }
}.onFailure { }.onFailure {
binding.tvEmptyMsg.visible() binding.tvEmptyMsg.visible()

Loading…
Cancel
Save