|
|
@ -40,7 +40,8 @@ class ImportBookActivity : VMBaseActivity<ImportBookViewModel>(R.layout.activity |
|
|
|
private val subDocs = arrayListOf<DocumentFile>() |
|
|
|
private val subDocs = arrayListOf<DocumentFile>() |
|
|
|
private lateinit var adapter: ImportBookAdapter |
|
|
|
private lateinit var adapter: ImportBookAdapter |
|
|
|
private var localUriLiveData: LiveData<List<String>>? = null |
|
|
|
private var localUriLiveData: LiveData<List<String>>? = null |
|
|
|
private var path = FileUtils.getSdCardPath() |
|
|
|
private var sdPath = FileUtils.getSdCardPath() |
|
|
|
|
|
|
|
private var path = sdPath |
|
|
|
|
|
|
|
|
|
|
|
override val viewModel: ImportBookViewModel |
|
|
|
override val viewModel: ImportBookViewModel |
|
|
|
get() = getViewModel(ImportBookViewModel::class.java) |
|
|
|
get() = getViewModel(ImportBookViewModel::class.java) |
|
|
@ -159,7 +160,7 @@ class ImportBookActivity : VMBaseActivity<ImportBookViewModel>(R.layout.activity |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} ?: let { |
|
|
|
} ?: let { |
|
|
|
tv_path.text = path |
|
|
|
tv_path.text = path.replace(sdPath, "SD") |
|
|
|
val docList = arrayListOf<DocItem>() |
|
|
|
val docList = arrayListOf<DocItem>() |
|
|
|
File(path).listFiles()?.forEach { |
|
|
|
File(path).listFiles()?.forEach { |
|
|
|
if (it.isDirectory) { |
|
|
|
if (it.isDirectory) { |
|
|
@ -228,7 +229,7 @@ class ImportBookActivity : VMBaseActivity<ImportBookViewModel>(R.layout.activity |
|
|
|
@Synchronized |
|
|
|
@Synchronized |
|
|
|
private fun goBackDir(): Boolean { |
|
|
|
private fun goBackDir(): Boolean { |
|
|
|
if (rootDoc == null) { |
|
|
|
if (rootDoc == null) { |
|
|
|
if (path != FileUtils.getSdCardPath()) { |
|
|
|
if (path != sdPath) { |
|
|
|
File(path).parent?.let { |
|
|
|
File(path).parent?.let { |
|
|
|
path = it |
|
|
|
path = it |
|
|
|
upPath() |
|
|
|
upPath() |
|
|
|