From 7ee45823039e99fc29cb45677515a2884fb0f3c9 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 30 Jan 2020 12:44:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/importbook/ImportBookActivity.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt b/app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt index 286549dda..1d83fcbe0 100644 --- a/app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt @@ -1,5 +1,6 @@ package io.legado.app.ui.importbook +import android.annotation.SuppressLint import android.app.Activity import android.content.Intent import android.net.Uri @@ -58,16 +59,16 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity } } + @SuppressLint("SetTextI18n") private fun upPath() { - rootDoc?.let { - var path = it.name + File.separator + subDirs.joinToString(File.separator) - if (!path.endsWith(File.separator)) { - path += File.separator - } - tv_path.text = path - var doc = rootDoc + rootDoc?.let { rootDoc -> + tv_path.text = rootDoc.name.toString() + File.separator + var doc: DocumentFile? = rootDoc 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 { importBookAdapter.setItems(it.toList())