mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
9753d0c608
commit
8100913489
@ -138,13 +138,14 @@ class ImportBookActivity : VMBaseActivity<ActivityImportBookBinding, ImportBookV
|
||||
lastPath.isContentScheme() -> {
|
||||
val rootUri = Uri.parse(lastPath)
|
||||
kotlin.runCatching {
|
||||
DocumentFile.fromTreeUri(this, rootUri)?.let {
|
||||
subDocs.clear()
|
||||
rootDoc = FileDoc.fromDocumentFile(it)
|
||||
upDocs(rootDoc!!)
|
||||
} ?: let {
|
||||
val doc = DocumentFile.fromTreeUri(this, rootUri)
|
||||
if (doc == null || doc.name.isNullOrEmpty()) {
|
||||
binding.tvEmptyMsg.visible()
|
||||
selectFolder.launch(null)
|
||||
} else {
|
||||
subDocs.clear()
|
||||
rootDoc = FileDoc.fromDocumentFile(doc)
|
||||
upDocs(rootDoc!!)
|
||||
}
|
||||
}.onFailure {
|
||||
binding.tvEmptyMsg.visible()
|
||||
|
Loading…
Reference in New Issue
Block a user