优化打开文件

pull/915/head
gedoor 4 years ago
parent 4ff399b4bb
commit 2b891ccf2b
  1. 8
      app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleActivity.kt
  2. 8
      app/src/main/java/io/legado/app/ui/association/ImportRssSourceActivity.kt

@ -51,18 +51,10 @@ class ImportReplaceRuleActivity :
viewModel.import(it) viewModel.import(it)
return return
} }
intent.getStringExtra("filePath")?.let {
viewModel.importFromFilePath(it)
return
}
intent.data?.let { intent.data?.let {
when (it.path) { when (it.path) {
"/importonline" -> it.getQueryParameter("src")?.let { url -> "/importonline" -> it.getQueryParameter("src")?.let { url ->
if (url.startsWith("http", false)) {
viewModel.import(url) viewModel.import(url)
} else {
viewModel.importFromFilePath(url)
}
} }
else -> { else -> {
binding.rotateLoading.hide() binding.rotateLoading.hide()

@ -51,18 +51,10 @@ class ImportRssSourceActivity :
viewModel.importSource(it) viewModel.importSource(it)
return return
} }
intent.getStringExtra("filePath")?.let {
viewModel.importSourceFromFilePath(it)
return
}
intent.data?.let { intent.data?.let {
when (it.path) { when (it.path) {
"/importonline" -> it.getQueryParameter("src")?.let { url -> "/importonline" -> it.getQueryParameter("src")?.let { url ->
if (url.startsWith("http", false)) {
viewModel.importSource(url) viewModel.importSource(url)
} else {
viewModel.importSourceFromFilePath(url)
}
} }
else -> { else -> {
binding.rotateLoading.hide() binding.rotateLoading.hide()

Loading…
Cancel
Save