mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
fb9189ac0c
commit
da0ca1b93f
@ -137,6 +137,7 @@ object PreferKey {
|
|||||||
const val openBookInfoByClickTitle = "openBookInfoByClickTitle"
|
const val openBookInfoByClickTitle = "openBookInfoByClickTitle"
|
||||||
const val defaultHomePage = "defaultHomePage"
|
const val defaultHomePage = "defaultHomePage"
|
||||||
const val showBookshelfFastScroller = "showBookshelfFastScroller"
|
const val showBookshelfFastScroller = "showBookshelfFastScroller"
|
||||||
|
const val importKeepEnable = "importKeepEnable"
|
||||||
|
|
||||||
const val cPrimary = "colorPrimary"
|
const val cPrimary = "colorPrimary"
|
||||||
const val cAccent = "colorAccent"
|
const val cAccent = "colorAccent"
|
||||||
|
@ -420,6 +420,11 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
|
|||||||
|
|
||||||
val importKeepName get() = appCtx.getPrefBoolean(PreferKey.importKeepName)
|
val importKeepName get() = appCtx.getPrefBoolean(PreferKey.importKeepName)
|
||||||
val importKeepGroup get() = appCtx.getPrefBoolean(PreferKey.importKeepGroup)
|
val importKeepGroup get() = appCtx.getPrefBoolean(PreferKey.importKeepGroup)
|
||||||
|
var importKeepEnable: Boolean
|
||||||
|
get() = appCtx.getPrefBoolean(PreferKey.importKeepEnable, false)
|
||||||
|
set(value) {
|
||||||
|
appCtx.putPrefBoolean(PreferKey.importKeepEnable, value)
|
||||||
|
}
|
||||||
|
|
||||||
var preDownloadNum
|
var preDownloadNum
|
||||||
get() = appCtx.getPrefInt(PreferKey.preDownloadNum, 10)
|
get() = appCtx.getPrefInt(PreferKey.preDownloadNum, 10)
|
||||||
|
@ -142,6 +142,8 @@ class ImportBookSourceDialog() : BaseDialogFragment(R.layout.dialog_recycler_vie
|
|||||||
?.isChecked = AppConfig.importKeepName
|
?.isChecked = AppConfig.importKeepName
|
||||||
binding.toolBar.menu.findItem(R.id.menu_keep_group)
|
binding.toolBar.menu.findItem(R.id.menu_keep_group)
|
||||||
?.isChecked = AppConfig.importKeepGroup
|
?.isChecked = AppConfig.importKeepGroup
|
||||||
|
binding.toolBar.menu.findItem(R.id.menu_keep_enable)
|
||||||
|
?.isChecked = AppConfig.importKeepEnable
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("InflateParams", "NotifyDataSetChanged")
|
@SuppressLint("InflateParams", "NotifyDataSetChanged")
|
||||||
@ -179,6 +181,11 @@ class ImportBookSourceDialog() : BaseDialogFragment(R.layout.dialog_recycler_vie
|
|||||||
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
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,7 @@ class ImportBookSourceViewModel(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<BookSource>()
|
val selectSource = arrayListOf<BookSource>()
|
||||||
selectStatus.forEachIndexed { index, b ->
|
selectStatus.forEachIndexed { index, b ->
|
||||||
if (b) {
|
if (b) {
|
||||||
@ -98,6 +99,10 @@ class ImportBookSourceViewModel(app: Application) : BaseViewModel(app) {
|
|||||||
if (keepGroup) {
|
if (keepGroup) {
|
||||||
source.bookSourceGroup = it.bookSourceGroup
|
source.bookSourceGroup = it.bookSourceGroup
|
||||||
}
|
}
|
||||||
|
if (keepEnable) {
|
||||||
|
source.enabled = it.enabled
|
||||||
|
source.enabledExplore = it.enabledExplore
|
||||||
|
}
|
||||||
source.customOrder = it.customOrder
|
source.customOrder = it.customOrder
|
||||||
}
|
}
|
||||||
if (!group.isNullOrEmpty()) {
|
if (!group.isNullOrEmpty()) {
|
||||||
|
@ -410,8 +410,8 @@ class BookSourceEditActivity :
|
|||||||
"intro" -> searchRule.intro =
|
"intro" -> searchRule.intro =
|
||||||
viewModel.ruleComplete(it.value, searchRule.bookList)
|
viewModel.ruleComplete(it.value, searchRule.bookList)
|
||||||
|
|
||||||
"updateTime" -> searchRule.updateTime =
|
// "updateTime" -> searchRule.updateTime =
|
||||||
viewModel.ruleComplete(it.value, searchRule.bookList)
|
// viewModel.ruleComplete(it.value, searchRule.bookList)
|
||||||
|
|
||||||
"wordCount" -> searchRule.wordCount =
|
"wordCount" -> searchRule.wordCount =
|
||||||
viewModel.ruleComplete(it.value, searchRule.bookList)
|
viewModel.ruleComplete(it.value, searchRule.bookList)
|
||||||
@ -442,8 +442,8 @@ class BookSourceEditActivity :
|
|||||||
"intro" -> exploreRule.intro =
|
"intro" -> exploreRule.intro =
|
||||||
viewModel.ruleComplete(it.value, exploreRule.bookList)
|
viewModel.ruleComplete(it.value, exploreRule.bookList)
|
||||||
|
|
||||||
"updateTime" -> exploreRule.updateTime =
|
// "updateTime" -> exploreRule.updateTime =
|
||||||
viewModel.ruleComplete(it.value, exploreRule.bookList)
|
// viewModel.ruleComplete(it.value, exploreRule.bookList)
|
||||||
|
|
||||||
"wordCount" -> exploreRule.wordCount =
|
"wordCount" -> exploreRule.wordCount =
|
||||||
viewModel.ruleComplete(it.value, exploreRule.bookList)
|
viewModel.ruleComplete(it.value, exploreRule.bookList)
|
||||||
@ -471,8 +471,8 @@ class BookSourceEditActivity :
|
|||||||
"intro" -> bookInfoRule.intro =
|
"intro" -> bookInfoRule.intro =
|
||||||
viewModel.ruleComplete(it.value, bookInfoRule.init)
|
viewModel.ruleComplete(it.value, bookInfoRule.init)
|
||||||
|
|
||||||
"updateTime" -> bookInfoRule.updateTime =
|
// "updateTime" -> bookInfoRule.updateTime =
|
||||||
viewModel.ruleComplete(it.value, bookInfoRule.init)
|
// viewModel.ruleComplete(it.value, bookInfoRule.init)
|
||||||
|
|
||||||
"wordCount" -> bookInfoRule.wordCount =
|
"wordCount" -> bookInfoRule.wordCount =
|
||||||
viewModel.ruleComplete(it.value, bookInfoRule.init)
|
viewModel.ruleComplete(it.value, bookInfoRule.init)
|
||||||
|
@ -31,4 +31,10 @@
|
|||||||
android:checkable="true"
|
android:checkable="true"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
|
|
||||||
</menu>
|
<item
|
||||||
|
android:id="@+id/menu_keep_enable"
|
||||||
|
android:title="@string/keep_enable"
|
||||||
|
android:checkable="true"
|
||||||
|
app:showAsAction="never" />
|
||||||
|
|
||||||
|
</menu>
|
||||||
|
@ -1131,4 +1131,5 @@
|
|||||||
<string name="default_home_page">默认主页</string>
|
<string name="default_home_page">默认主页</string>
|
||||||
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
<string name="export_all_use_book_source">导出所有书的书源</string>
|
<string name="export_all_use_book_source">导出所有书的书源</string>
|
||||||
|
<string name="keep_enable">保留启用状态</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1134,4 +1134,5 @@
|
|||||||
<string name="default_home_page">默认主页</string>
|
<string name="default_home_page">默认主页</string>
|
||||||
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
<string name="export_all_use_book_source">导出所有书的书源</string>
|
<string name="export_all_use_book_source">导出所有书的书源</string>
|
||||||
|
<string name="keep_enable">保留启用状态</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1134,4 +1134,5 @@
|
|||||||
<string name="default_home_page">默认主页</string>
|
<string name="default_home_page">默认主页</string>
|
||||||
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
<string name="export_all_use_book_source">导出所有书的书源</string>
|
<string name="export_all_use_book_source">导出所有书的书源</string>
|
||||||
|
<string name="keep_enable">保留启用状态</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1129,4 +1129,5 @@ Còn </string>
|
|||||||
<string name="export_wait">等待导出</string>
|
<string name="export_wait">等待导出</string>
|
||||||
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
<string name="export_all_use_book_source">导出所有书的书源</string>
|
<string name="export_all_use_book_source">导出所有书的书源</string>
|
||||||
|
<string name="keep_enable">保留启用状态</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1130,4 +1130,5 @@
|
|||||||
<string name="export_wait">等待导出</string>
|
<string name="export_wait">等待导出</string>
|
||||||
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
<string name="export_all_use_book_source">导出所有书的书源</string>
|
<string name="export_all_use_book_source">导出所有书的书源</string>
|
||||||
|
<string name="keep_enable">保留启用状态</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1132,4 +1132,5 @@
|
|||||||
<string name="export_wait">等待导出</string>
|
<string name="export_wait">等待导出</string>
|
||||||
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
<string name="export_all_use_book_source">导出所有书的书源</string>
|
<string name="export_all_use_book_source">导出所有书的书源</string>
|
||||||
|
<string name="keep_enable">保留启用状态</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1132,4 +1132,5 @@
|
|||||||
<string name="export_wait">等待导出</string>
|
<string name="export_wait">等待导出</string>
|
||||||
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
<string name="export_all_use_book_source">导出所有书的书源</string>
|
<string name="export_all_use_book_source">导出所有书的书源</string>
|
||||||
|
<string name="keep_enable">保留启用状态</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1134,4 +1134,5 @@
|
|||||||
<string name="default_home_page">默认主页</string>
|
<string name="default_home_page">默认主页</string>
|
||||||
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
<string name="export_all_use_book_source">导出所有书的书源</string>
|
<string name="export_all_use_book_source">导出所有书的书源</string>
|
||||||
|
<string name="keep_enable">保留启用状态</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user