This commit is contained in:
Horis 2023-10-18 21:39:15 +08:00
parent 46087e8fb3
commit 297cc92c59
2 changed files with 11 additions and 0 deletions

View File

@ -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
}

View File

@ -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<RssSource>()
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()) {