mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
46087e8fb3
commit
297cc92c59
@ -141,6 +141,8 @@ class ImportRssSourceDialog() : BaseDialogFragment(R.layout.dialog_recycler_view
|
|||||||
AppConfig.importKeepName
|
AppConfig.importKeepName
|
||||||
binding.toolBar.menu.findItem(R.id.menu_keep_group)?.isChecked =
|
binding.toolBar.menu.findItem(R.id.menu_keep_group)?.isChecked =
|
||||||
AppConfig.importKeepGroup
|
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_new_source)?.isVisible = false
|
||||||
binding.toolBar.menu.findItem(R.id.menu_select_update_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
|
item.isChecked = !item.isChecked
|
||||||
putPrefBoolean(PreferKey.importKeepGroup, item.isChecked)
|
putPrefBoolean(PreferKey.importKeepGroup, item.isChecked)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
R.id.menu_keep_enable -> {
|
||||||
|
item.isChecked = !item.isChecked
|
||||||
|
AppConfig.importKeepEnable = item.isChecked
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@ class ImportRssSourceViewModel(app: Application) : BaseViewModel(app) {
|
|||||||
val group = groupName?.trim()
|
val group = groupName?.trim()
|
||||||
val keepName = AppConfig.importKeepName
|
val keepName = AppConfig.importKeepName
|
||||||
val keepGroup = AppConfig.importKeepGroup
|
val keepGroup = AppConfig.importKeepGroup
|
||||||
|
val keepEnable = AppConfig.importKeepEnable
|
||||||
val selectSource = arrayListOf<RssSource>()
|
val selectSource = arrayListOf<RssSource>()
|
||||||
selectStatus.forEachIndexed { index, b ->
|
selectStatus.forEachIndexed { index, b ->
|
||||||
if (b) {
|
if (b) {
|
||||||
@ -72,6 +73,9 @@ class ImportRssSourceViewModel(app: Application) : BaseViewModel(app) {
|
|||||||
if (keepGroup) {
|
if (keepGroup) {
|
||||||
source.sourceGroup = it.sourceGroup
|
source.sourceGroup = it.sourceGroup
|
||||||
}
|
}
|
||||||
|
if (keepEnable) {
|
||||||
|
source.enabled = it.enabled
|
||||||
|
}
|
||||||
source.customOrder = it.customOrder
|
source.customOrder = it.customOrder
|
||||||
}
|
}
|
||||||
if (!group.isNullOrEmpty()) {
|
if (!group.isNullOrEmpty()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user