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()