|
|
@ -6,6 +6,7 @@ import io.legado.app.R |
|
|
|
import io.legado.app.base.VMBaseActivity |
|
|
|
import io.legado.app.base.VMBaseActivity |
|
|
|
import io.legado.app.databinding.ActivityTranslucenceBinding |
|
|
|
import io.legado.app.databinding.ActivityTranslucenceBinding |
|
|
|
import io.legado.app.lib.dialogs.alert |
|
|
|
import io.legado.app.lib.dialogs.alert |
|
|
|
|
|
|
|
import io.legado.app.utils.showDialog |
|
|
|
import io.legado.app.utils.toastOnUi |
|
|
|
import io.legado.app.utils.toastOnUi |
|
|
|
import io.legado.app.utils.viewbindingdelegate.viewBinding |
|
|
|
import io.legado.app.utils.viewbindingdelegate.viewBinding |
|
|
|
|
|
|
|
|
|
|
@ -22,8 +23,9 @@ class OnLineImportActivity : |
|
|
|
override fun onActivityCreated(savedInstanceState: Bundle?) { |
|
|
|
override fun onActivityCreated(savedInstanceState: Bundle?) { |
|
|
|
viewModel.successLive.observe(this) { |
|
|
|
viewModel.successLive.observe(this) { |
|
|
|
when (it.first) { |
|
|
|
when (it.first) { |
|
|
|
"bookSource" -> ImportBookSourceDialog |
|
|
|
"bookSource" -> supportFragmentManager.showDialog( |
|
|
|
.start(supportFragmentManager, it.second, true) |
|
|
|
ImportBookSourceDialog(it.second, true) |
|
|
|
|
|
|
|
) |
|
|
|
"rssSource" -> ImportRssSourceDialog |
|
|
|
"rssSource" -> ImportRssSourceDialog |
|
|
|
.start(supportFragmentManager, it.second, true) |
|
|
|
.start(supportFragmentManager, it.second, true) |
|
|
|
"replaceRule" -> ImportReplaceRuleDialog |
|
|
|
"replaceRule" -> ImportReplaceRuleDialog |
|
|
@ -40,7 +42,9 @@ class OnLineImportActivity : |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
when (it.path) { |
|
|
|
when (it.path) { |
|
|
|
"/bookSource" -> ImportBookSourceDialog.start(supportFragmentManager, url, true) |
|
|
|
"/bookSource" -> supportFragmentManager.showDialog( |
|
|
|
|
|
|
|
ImportBookSourceDialog(url, true) |
|
|
|
|
|
|
|
) |
|
|
|
"/rssSource" -> ImportRssSourceDialog.start(supportFragmentManager, url, true) |
|
|
|
"/rssSource" -> ImportRssSourceDialog.start(supportFragmentManager, url, true) |
|
|
|
"/replaceRule" -> ImportReplaceRuleDialog.start(supportFragmentManager, url, true) |
|
|
|
"/replaceRule" -> ImportReplaceRuleDialog.start(supportFragmentManager, url, true) |
|
|
|
"/textTocRule" -> viewModel.getText(url) { json -> |
|
|
|
"/textTocRule" -> viewModel.getText(url) { json -> |
|
|
@ -56,7 +60,9 @@ class OnLineImportActivity : |
|
|
|
viewModel.importReadConfig(bytes, this::finallyDialog) |
|
|
|
viewModel.importReadConfig(bytes, this::finallyDialog) |
|
|
|
} |
|
|
|
} |
|
|
|
"/importonline" -> when (it.host) { |
|
|
|
"/importonline" -> when (it.host) { |
|
|
|
"booksource" -> ImportBookSourceDialog.start(supportFragmentManager, url, true) |
|
|
|
"booksource" -> supportFragmentManager.showDialog( |
|
|
|
|
|
|
|
ImportBookSourceDialog(url, true) |
|
|
|
|
|
|
|
) |
|
|
|
"rsssource" -> ImportRssSourceDialog.start(supportFragmentManager, url, true) |
|
|
|
"rsssource" -> ImportRssSourceDialog.start(supportFragmentManager, url, true) |
|
|
|
"replace" -> ImportReplaceRuleDialog.start(supportFragmentManager, url, true) |
|
|
|
"replace" -> ImportReplaceRuleDialog.start(supportFragmentManager, url, true) |
|
|
|
else -> { |
|
|
|
else -> { |
|
|
|