From 8ddcb738928f5889dc2fecc011f7fdd6d68e3a77 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 11 Mar 2020 22:25:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 1 - .../java/io/legado/app/ui/book/local/ImportBookActivity.kt | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 633b8ba1b..f2d9e96cf 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -139,7 +139,6 @@ dependencies { def room_version = '2.2.4' implementation "androidx.room:room-runtime:$room_version" kapt "androidx.room:room-compiler:$room_version" - kapt "android.arch.persistence.room:compiler:$room_version" //paging implementation 'androidx.paging:paging-runtime:2.1.1' diff --git a/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt index 2958325fe..2296423b4 100644 --- a/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt @@ -40,7 +40,8 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity private val subDocs = arrayListOf() private lateinit var adapter: ImportBookAdapter private var localUriLiveData: LiveData>? = null - private var path = FileUtils.getSdCardPath() + private var sdPath = FileUtils.getSdCardPath() + private var path = sdPath override val viewModel: ImportBookViewModel get() = getViewModel(ImportBookViewModel::class.java) @@ -159,7 +160,7 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity } } } ?: let { - tv_path.text = path + tv_path.text = path.replace(sdPath, "SD") val docList = arrayListOf() File(path).listFiles()?.forEach { if (it.isDirectory) { @@ -228,7 +229,7 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity @Synchronized private fun goBackDir(): Boolean { if (rootDoc == null) { - if (path != FileUtils.getSdCardPath()) { + if (path != sdPath) { File(path).parent?.let { path = it upPath()