diff --git a/app/src/main/java/io/legado/app/ui/association/ImportBookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/association/ImportBookSourceActivity.kt index 1c6e84847..0a7d46582 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportBookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportBookSourceActivity.kt @@ -13,6 +13,7 @@ import io.legado.app.lib.dialogs.noButton import io.legado.app.lib.dialogs.okButton import io.legado.app.utils.applyTint import io.legado.app.utils.getViewModel +import kotlinx.android.synthetic.main.activity_translucence.* import org.jetbrains.anko.toast class ImportBookSourceActivity : VMBaseActivity( @@ -24,10 +25,13 @@ class ImportBookSourceActivity : VMBaseActivity( get() = getViewModel(ImportBookSourceViewModel::class.java) override fun onActivityCreated(savedInstanceState: Bundle?) { + rotate_loading.show() viewModel.errorLiveData.observe(this, Observer { + rotate_loading.hide() errorDialog(it) }) viewModel.successLiveData.observe(this, Observer { + rotate_loading.hide() successDialog(it) }) initData() @@ -58,7 +62,9 @@ class ImportBookSourceActivity : VMBaseActivity( } } else -> { + rotate_loading.hide() toast("格式不对") + finish() } } } diff --git a/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleActivity.kt b/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleActivity.kt index 489d0fb01..2b09dd4d9 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleActivity.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleActivity.kt @@ -13,6 +13,7 @@ import io.legado.app.lib.dialogs.noButton import io.legado.app.lib.dialogs.okButton import io.legado.app.utils.applyTint import io.legado.app.utils.getViewModel +import kotlinx.android.synthetic.main.activity_translucence.* import org.jetbrains.anko.toast class ImportReplaceRuleActivity : VMBaseActivity( @@ -24,10 +25,13 @@ class ImportReplaceRuleActivity : VMBaseActivity( get() = getViewModel(ImportReplaceRuleViewModel::class.java) override fun onActivityCreated(savedInstanceState: Bundle?) { + rotate_loading.show() viewModel.errorLiveData.observe(this, Observer { + rotate_loading.hide() errorDialog(it) }) viewModel.successLiveData.observe(this, Observer { + rotate_loading.hide() successDialog(it) }) initData() @@ -58,7 +62,9 @@ class ImportReplaceRuleActivity : VMBaseActivity( } } else -> { + rotate_loading.hide() toast("格式不对") + finish() } } } diff --git a/app/src/main/java/io/legado/app/ui/association/ImportRssSourceActivity.kt b/app/src/main/java/io/legado/app/ui/association/ImportRssSourceActivity.kt index 2b96c5a47..b976e8cee 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportRssSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportRssSourceActivity.kt @@ -13,6 +13,7 @@ import io.legado.app.lib.dialogs.noButton import io.legado.app.lib.dialogs.okButton import io.legado.app.utils.applyTint import io.legado.app.utils.getViewModel +import kotlinx.android.synthetic.main.activity_translucence.* import org.jetbrains.anko.toast class ImportRssSourceActivity : VMBaseActivity( @@ -24,10 +25,13 @@ class ImportRssSourceActivity : VMBaseActivity( get() = getViewModel(ImportRssSourceViewModel::class.java) override fun onActivityCreated(savedInstanceState: Bundle?) { + rotate_loading.show() viewModel.errorLiveData.observe(this, Observer { + rotate_loading.hide() errorDialog(it) }) viewModel.successLiveData.observe(this, Observer { + rotate_loading.hide() successDialog(it) }) initData() @@ -58,7 +62,9 @@ class ImportRssSourceActivity : VMBaseActivity( } } else -> { + rotate_loading.hide() toast("格式不对") + finish() } } } diff --git a/app/src/main/res/layout/activity_translucence.xml b/app/src/main/res/layout/activity_translucence.xml index 0760b0648..946439b5d 100644 --- a/app/src/main/res/layout/activity_translucence.xml +++ b/app/src/main/res/layout/activity_translucence.xml @@ -2,6 +2,19 @@ + + \ No newline at end of file