From 297cc92c590b34e4ae49271cf852218fc4493cb9 Mon Sep 17 00:00:00 2001 From: Horis <821938089@qq.com> Date: Wed, 18 Oct 2023 21:39:15 +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 --- .../io/legado/app/ui/association/ImportRssSourceDialog.kt | 7 +++++++ .../legado/app/ui/association/ImportRssSourceViewModel.kt | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/association/ImportRssSourceDialog.kt b/app/src/main/java/io/legado/app/ui/association/ImportRssSourceDialog.kt index 8c4e050c75dc..5eb2a03c9b07 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportRssSourceDialog.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportRssSourceDialog.kt @@ -141,6 +141,8 @@ class ImportRssSourceDialog() : BaseDialogFragment(R.layout.dialog_recycler_view AppConfig.importKeepName binding.toolBar.menu.findItem(R.id.menu_keep_group)?.isChecked = AppConfig.importKeepGroup + binding.toolBar.menu.findItem(R.id.menu_keep_enable)?.isChecked = + AppConfig.importKeepEnable binding.toolBar.menu.findItem(R.id.menu_select_new_source)?.isVisible = false binding.toolBar.menu.findItem(R.id.menu_select_update_source)?.isVisible = false } @@ -158,6 +160,11 @@ class ImportRssSourceDialog() : BaseDialogFragment(R.layout.dialog_recycler_view item.isChecked = !item.isChecked putPrefBoolean(PreferKey.importKeepGroup, item.isChecked) } + + R.id.menu_keep_enable -> { + item.isChecked = !item.isChecked + AppConfig.importKeepEnable = item.isChecked + } } return false } diff --git a/app/src/main/java/io/legado/app/ui/association/ImportRssSourceViewModel.kt b/app/src/main/java/io/legado/app/ui/association/ImportRssSourceViewModel.kt index 8490d10c448f..c3dce969a7bd 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportRssSourceViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportRssSourceViewModel.kt @@ -61,6 +61,7 @@ class ImportRssSourceViewModel(app: Application) : BaseViewModel(app) { val group = groupName?.trim() val keepName = AppConfig.importKeepName val keepGroup = AppConfig.importKeepGroup + val keepEnable = AppConfig.importKeepEnable val selectSource = arrayListOf() selectStatus.forEachIndexed { index, b -> if (b) { @@ -72,6 +73,9 @@ class ImportRssSourceViewModel(app: Application) : BaseViewModel(app) { if (keepGroup) { source.sourceGroup = it.sourceGroup } + if (keepEnable) { + source.enabled = it.enabled + } source.customOrder = it.customOrder } if (!group.isNullOrEmpty()) {