统一导入入口

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
android:name=".ui.association.ImportBookSourceActivity"
android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
android:theme="@style/AppTheme.Transparent">
</activity>
android:theme="@style/AppTheme.Transparent" />
<!-- 导入订阅源 -->
<activity
android:name=".ui.association.ImportRssSourceActivity"
android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
android:theme="@style/AppTheme.Transparent">
</activity>
android:theme="@style/AppTheme.Transparent" />
<!-- 导入替换规则 -->
<activity
android:name=".ui.association.ImportReplaceRuleActivity"
android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
android:theme="@style/AppTheme.Transparent">
</activity>
android:theme="@style/AppTheme.Transparent" />
<!-- 打开文件 -->
<activity
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.help.IntentDataHelp
import io.legado.app.lib.dialogs.alert
import io.legado.app.utils.toastOnUi
import io.legado.app.utils.viewbindingdelegate.viewBinding
@ -49,19 +47,8 @@ class ImportBookSourceActivity :
viewModel.importSource(it)
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()
}
private fun errorDialog(msg: String) {
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.help.IntentDataHelp
import io.legado.app.lib.dialogs.alert
import io.legado.app.utils.toastOnUi
import io.legado.app.utils.viewbindingdelegate.viewBinding
class ImportReplaceRuleActivity :
@ -46,19 +45,8 @@ class ImportReplaceRuleActivity :
viewModel.import(it)
return
}
intent.data?.let {
when (it.path) {
"/importonline" -> it.getQueryParameter("src")?.let { url ->
viewModel.import(url)
}
else -> {
binding.rotateLoading.hide()
toastOnUi("格式不对")
finish()
}
}
} ?: finish()
}
private fun errorDialog(msg: String) {
alert("导入出错", msg) {

@ -8,8 +8,6 @@ import io.legado.app.constant.Theme
import io.legado.app.databinding.ActivityTranslucenceBinding
import io.legado.app.help.IntentDataHelp
import io.legado.app.lib.dialogs.alert
import io.legado.app.utils.toastOnUi
import io.legado.app.utils.viewbindingdelegate.viewBinding
class ImportRssSourceActivity :
@ -48,19 +46,8 @@ class ImportRssSourceActivity :
viewModel.importSource(it)
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()
}
private fun errorDialog(msg: String) {
alert(getString(R.string.error), msg) {

Loading…
Cancel
Save