优化打开文件

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)
return
}
intent.getStringExtra("filePath")?.let {
viewModel.importFromFilePath(it)
return
}
intent.data?.let {
when (it.path) {
"/importonline" -> it.getQueryParameter("src")?.let { url ->
if (url.startsWith("http", false)) {
viewModel.import(url)
} else {
viewModel.importFromFilePath(url)
}
}
else -> {
binding.rotateLoading.hide()

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

Loading…
Cancel
Save