pull/83/head
kunfei 5 years ago
parent a9a14ce8b1
commit 7ee4582303
  1. 17
      app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt

@ -1,5 +1,6 @@
package io.legado.app.ui.importbook package io.legado.app.ui.importbook
import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
@ -58,16 +59,16 @@ class ImportBookActivity : VMBaseActivity<ImportBookViewModel>(R.layout.activity
} }
} }
@SuppressLint("SetTextI18n")
private fun upPath() { private fun upPath() {
rootDoc?.let { rootDoc?.let { rootDoc ->
var path = it.name + File.separator + subDirs.joinToString(File.separator) tv_path.text = rootDoc.name.toString() + File.separator
if (!path.endsWith(File.separator)) { var doc: DocumentFile? = rootDoc
path += File.separator
}
tv_path.text = path
var doc = rootDoc
for (dirName in subDirs) { for (dirName in subDirs) {
doc = rootDoc?.findFile(dirName) doc = doc?.findFile(dirName)
doc?.let {
tv_path.text = tv_path.text.toString() + it.name + File.separator
}
} }
doc?.listFiles()?.let { doc?.listFiles()?.let {
importBookAdapter.setItems(it.toList()) importBookAdapter.setItems(it.toList())

Loading…
Cancel
Save