统一导入入口

pull/1155/head
gedoor 3 years ago
parent ee2dff2593
commit 95638ab95c
  1. 12
      app/src/main/AndroidManifest.xml
  2. 15
      app/src/main/java/io/legado/app/ui/association/ImportBookSourceActivity.kt
  3. 14
      app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleActivity.kt
  4. 15
      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,18 +47,7 @@ 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()
finish()
}
private fun errorDialog(msg: String) {

@ -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,18 +45,7 @@ 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()
finish()
}
private fun errorDialog(msg: String) {

@ -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,18 +46,7 @@ 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()
finish()
}
private fun errorDialog(msg: String) {

Loading…
Cancel
Save