统一导入入口

pull/1155/head
gedoor 3 years ago
parent ee2dff2593
commit 95638ab95c
  1. 12
      app/src/main/AndroidManifest.xml
  2. 13
      app/src/main/java/io/legado/app/ui/association/ImportBookSourceActivity.kt
  3. 12
      app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleActivity.kt
  4. 13
      app/src/main/java/io/legado/app/ui/association/ImportRssSourceActivity.kt

@ -350,23 +350,17 @@
<activity <activity
android:name=".ui.association.ImportBookSourceActivity" android:name=".ui.association.ImportBookSourceActivity"
android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout" android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
android:theme="@style/AppTheme.Transparent"> android:theme="@style/AppTheme.Transparent" />
</activity>
<!-- 导入订阅源 --> <!-- 导入订阅源 -->
<activity <activity
android:name=".ui.association.ImportRssSourceActivity" android:name=".ui.association.ImportRssSourceActivity"
android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout" android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
android:theme="@style/AppTheme.Transparent"> android:theme="@style/AppTheme.Transparent" />
</activity>
<!-- 导入替换规则 --> <!-- 导入替换规则 -->
<activity <activity
android:name=".ui.association.ImportReplaceRuleActivity" android:name=".ui.association.ImportReplaceRuleActivity"
android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout" android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
android:theme="@style/AppTheme.Transparent"> android:theme="@style/AppTheme.Transparent" />
</activity>
<!-- 打开文件 --> <!-- 打开文件 -->
<activity <activity
android:name=".ui.association.FileAssociationActivity" android:name=".ui.association.FileAssociationActivity"

@ -8,8 +8,6 @@ import io.legado.app.constant.Theme
import io.legado.app.databinding.ActivityTranslucenceBinding import io.legado.app.databinding.ActivityTranslucenceBinding
import io.legado.app.help.IntentDataHelp import io.legado.app.help.IntentDataHelp
import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.alert
import io.legado.app.utils.toastOnUi
import io.legado.app.utils.viewbindingdelegate.viewBinding import io.legado.app.utils.viewbindingdelegate.viewBinding
@ -49,19 +47,8 @@ class ImportBookSourceActivity :
viewModel.importSource(it) viewModel.importSource(it)
return return
} }
intent.data?.let {
when (it.path) {
"/importonline" -> it.getQueryParameter("src")?.let { url ->
viewModel.importSource(url)
}
else -> {
binding.rotateLoading.hide()
toastOnUi(R.string.wrong_format)
finish() finish()
} }
}
} ?: finish()
}
private fun errorDialog(msg: String) { private fun errorDialog(msg: String) {
alert(getString(R.string.error), msg) { alert(getString(R.string.error), msg) {

@ -7,7 +7,6 @@ import io.legado.app.constant.Theme
import io.legado.app.databinding.ActivityTranslucenceBinding import io.legado.app.databinding.ActivityTranslucenceBinding
import io.legado.app.help.IntentDataHelp import io.legado.app.help.IntentDataHelp
import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.alert
import io.legado.app.utils.toastOnUi
import io.legado.app.utils.viewbindingdelegate.viewBinding import io.legado.app.utils.viewbindingdelegate.viewBinding
class ImportReplaceRuleActivity : class ImportReplaceRuleActivity :
@ -46,19 +45,8 @@ class ImportReplaceRuleActivity :
viewModel.import(it) viewModel.import(it)
return return
} }
intent.data?.let {
when (it.path) {
"/importonline" -> it.getQueryParameter("src")?.let { url ->
viewModel.import(url)
}
else -> {
binding.rotateLoading.hide()
toastOnUi("格式不对")
finish() finish()
} }
}
} ?: finish()
}
private fun errorDialog(msg: String) { private fun errorDialog(msg: String) {
alert("导入出错", msg) { alert("导入出错", msg) {

@ -8,8 +8,6 @@ import io.legado.app.constant.Theme
import io.legado.app.databinding.ActivityTranslucenceBinding import io.legado.app.databinding.ActivityTranslucenceBinding
import io.legado.app.help.IntentDataHelp import io.legado.app.help.IntentDataHelp
import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.alert
import io.legado.app.utils.toastOnUi
import io.legado.app.utils.viewbindingdelegate.viewBinding import io.legado.app.utils.viewbindingdelegate.viewBinding
class ImportRssSourceActivity : class ImportRssSourceActivity :
@ -48,19 +46,8 @@ class ImportRssSourceActivity :
viewModel.importSource(it) viewModel.importSource(it)
return return
} }
intent.data?.let {
when (it.path) {
"/importonline" -> it.getQueryParameter("src")?.let { url ->
viewModel.importSource(url)
}
else -> {
binding.rotateLoading.hide()
toastOnUi(R.string.wrong_format)
finish() finish()
} }
}
} ?: finish()
}
private fun errorDialog(msg: String) { private fun errorDialog(msg: String) {
alert(getString(R.string.error), msg) { alert(getString(R.string.error), msg) {

Loading…
Cancel
Save