From ceb2cd600ea2ff8edead3691d7c75b97b5ae31cf Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 11 Aug 2020 21:15:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/association/ImportBookSourceActivity.kt | 6 ++++++ .../app/ui/association/ImportReplaceRuleActivity.kt | 6 ++++++ .../app/ui/association/ImportRssSourceActivity.kt | 6 ++++++ app/src/main/res/layout/activity_translucence.xml | 13 +++++++++++++ 4 files changed, 31 insertions(+) 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