|
|
|
@ -62,8 +62,7 @@ class RemoteBookActivity : VMBaseActivity<ActivityImportBookBinding, RemoteBookV |
|
|
|
|
|
|
|
|
|
private fun initEvent() { |
|
|
|
|
binding.tvGoBack.setOnClickListener { |
|
|
|
|
viewModel.dirList.removeLastOrNull() |
|
|
|
|
upPath() |
|
|
|
|
goBackDir() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -97,6 +96,21 @@ class RemoteBookActivity : VMBaseActivity<ActivityImportBookBinding, RemoteBookV |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun onBackPressed() { |
|
|
|
|
if (!goBackDir()) { |
|
|
|
|
super.onBackPressed() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun goBackDir(): Boolean { |
|
|
|
|
if (viewModel.dirList.isEmpty()) { |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
viewModel.dirList.removeLastOrNull() |
|
|
|
|
upPath() |
|
|
|
|
return true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun upPath() { |
|
|
|
|
binding.tvGoBack.isEnabled = viewModel.dirList.isNotEmpty() |
|
|
|
|
var path = "books" + File.separator |
|
|
|
|