mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
e94f9e0c20
commit
1a46b33dd8
@ -152,53 +152,41 @@ class RssSourceEditActivity :
|
|||||||
binding.recyclerView.adapter = adapter
|
binding.recyclerView.adapter = adapter
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun upSourceView(source: RssSource? = viewModel.rssSource) {
|
private fun upSourceView(rs: RssSource? = viewModel.rssSource) {
|
||||||
source?.let {
|
rs?.let {
|
||||||
binding.cbIsEnable.isChecked = source.enabled
|
binding.cbIsEnable.isChecked = rs.enabled
|
||||||
binding.cbSingleUrl.isChecked = source.singleUrl
|
binding.cbSingleUrl.isChecked = rs.singleUrl
|
||||||
binding.cbIsEnableCookie.isChecked = source.enabledCookieJar == true
|
binding.cbIsEnableCookie.isChecked = rs.enabledCookieJar == true
|
||||||
binding.cbEnableJs.isChecked = source.enableJs
|
binding.cbEnableJs.isChecked = rs.enableJs
|
||||||
binding.cbEnableBaseUrl.isChecked = source.loadWithBaseUrl
|
binding.cbEnableBaseUrl.isChecked = rs.loadWithBaseUrl
|
||||||
}
|
}
|
||||||
sourceEntities.clear()
|
sourceEntities.clear()
|
||||||
sourceEntities.apply {
|
sourceEntities.apply {
|
||||||
add(EditEntity("sourceName", source?.sourceName, R.string.source_name))
|
add(EditEntity("sourceName", rs?.sourceName, R.string.source_name))
|
||||||
add(EditEntity("sourceUrl", source?.sourceUrl, R.string.source_url))
|
add(EditEntity("sourceUrl", rs?.sourceUrl, R.string.source_url))
|
||||||
add(EditEntity("sourceIcon", source?.sourceIcon, R.string.source_icon))
|
add(EditEntity("sourceIcon", rs?.sourceIcon, R.string.source_icon))
|
||||||
add(EditEntity("sourceGroup", source?.sourceGroup, R.string.source_group))
|
add(EditEntity("sourceGroup", rs?.sourceGroup, R.string.source_group))
|
||||||
add(EditEntity("sourceComment", source?.sourceComment, R.string.comment))
|
add(EditEntity("sourceComment", rs?.sourceComment, R.string.comment))
|
||||||
add(EditEntity("loginUrl", source?.loginUrl, R.string.login_url))
|
add(EditEntity("loginUrl", rs?.loginUrl, R.string.login_url))
|
||||||
add(EditEntity("loginUi", source?.loginUi, R.string.login_ui))
|
add(EditEntity("loginUi", rs?.loginUi, R.string.login_ui))
|
||||||
add(EditEntity("loginCheckJs", source?.loginCheckJs, R.string.login_check_js))
|
add(EditEntity("loginCheckJs", rs?.loginCheckJs, R.string.login_check_js))
|
||||||
add(EditEntity("coverDecodeJs", source?.coverDecodeJs, R.string.cover_decode_js))
|
add(EditEntity("coverDecodeJs", rs?.coverDecodeJs, R.string.cover_decode_js))
|
||||||
add(EditEntity("header", source?.header, R.string.source_http_header))
|
add(EditEntity("header", rs?.header, R.string.source_http_header))
|
||||||
add(EditEntity("variableComment", source?.variableComment, R.string.variable_comment))
|
add(EditEntity("variableComment", rs?.variableComment, R.string.variable_comment))
|
||||||
add(EditEntity("concurrentRate", source?.concurrentRate, R.string.concurrent_rate))
|
add(EditEntity("concurrentRate", rs?.concurrentRate, R.string.concurrent_rate))
|
||||||
add(EditEntity("sortUrl", source?.sortUrl, R.string.sort_url))
|
add(EditEntity("sortUrl", rs?.sortUrl, R.string.sort_url))
|
||||||
add(EditEntity("ruleArticles", source?.ruleArticles, R.string.r_articles))
|
add(EditEntity("ruleArticles", rs?.ruleArticles, R.string.r_articles))
|
||||||
add(EditEntity("ruleNextPage", source?.ruleNextPage, R.string.r_next))
|
add(EditEntity("ruleNextPage", rs?.ruleNextPage, R.string.r_next))
|
||||||
add(EditEntity("ruleTitle", source?.ruleTitle, R.string.r_title))
|
add(EditEntity("ruleTitle", rs?.ruleTitle, R.string.r_title))
|
||||||
add(EditEntity("rulePubDate", source?.rulePubDate, R.string.r_date))
|
add(EditEntity("rulePubDate", rs?.rulePubDate, R.string.r_date))
|
||||||
add(EditEntity("ruleDescription", source?.ruleDescription, R.string.r_description))
|
add(EditEntity("ruleDescription", rs?.ruleDescription, R.string.r_description))
|
||||||
add(EditEntity("ruleImage", source?.ruleImage, R.string.r_image))
|
add(EditEntity("ruleImage", rs?.ruleImage, R.string.r_image))
|
||||||
add(EditEntity("ruleLink", source?.ruleLink, R.string.r_link))
|
add(EditEntity("ruleLink", rs?.ruleLink, R.string.r_link))
|
||||||
add(EditEntity("ruleContent", source?.ruleContent, R.string.r_content))
|
add(EditEntity("ruleContent", rs?.ruleContent, R.string.r_content))
|
||||||
add(EditEntity("style", source?.style, R.string.r_style))
|
add(EditEntity("style", rs?.style, R.string.r_style))
|
||||||
add(EditEntity("injectJs", source?.injectJs, R.string.r_inject_js))
|
add(EditEntity("injectJs", rs?.injectJs, R.string.r_inject_js))
|
||||||
add(
|
add(EditEntity("contentWhitelist", rs?.contentWhitelist, R.string.c_whitelist))
|
||||||
EditEntity(
|
add(EditEntity("contentBlacklist", rs?.contentBlacklist, R.string.c_blacklist))
|
||||||
"contentWhitelist",
|
|
||||||
source?.contentWhitelist,
|
|
||||||
R.string.content_whitelist
|
|
||||||
)
|
|
||||||
)
|
|
||||||
add(
|
|
||||||
EditEntity(
|
|
||||||
"contentBlacklist",
|
|
||||||
source?.contentBlacklist,
|
|
||||||
R.string.content_blacklist
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
adapter.editEntities = sourceEntities
|
adapter.editEntities = sourceEntities
|
||||||
}
|
}
|
||||||
|
@ -1065,6 +1065,6 @@
|
|||||||
<string name="update_book_fail">更新失败</string>
|
<string name="update_book_fail">更新失败</string>
|
||||||
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
|
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
|
||||||
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
|
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
|
||||||
<string name="content_whitelist">白名单(contentWhitelist)</string>
|
<string name="c_whitelist">白名单(contentWhitelist)</string>
|
||||||
<string name="content_blacklist">黑名单(contentBlacklist)</string>
|
<string name="c_blacklist">黑名单(contentBlacklist)</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1068,6 +1068,6 @@
|
|||||||
<string name="update_book_fail">更新失败</string>
|
<string name="update_book_fail">更新失败</string>
|
||||||
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
|
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
|
||||||
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
|
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
|
||||||
<string name="content_whitelist">白名单(contentWhitelist)</string>
|
<string name="c_whitelist">白名单(contentWhitelist)</string>
|
||||||
<string name="content_blacklist">黑名单(contentBlacklist)</string>
|
<string name="c_blacklist">黑名单(contentBlacklist)</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1068,6 +1068,6 @@
|
|||||||
<string name="update_book_fail">更新失败</string>
|
<string name="update_book_fail">更新失败</string>
|
||||||
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
|
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
|
||||||
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
|
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
|
||||||
<string name="content_whitelist">白名单(contentWhitelist)</string>
|
<string name="c_whitelist">白名单(contentWhitelist)</string>
|
||||||
<string name="content_blacklist">黑名单(contentBlacklist)</string>
|
<string name="c_blacklist">黑名单(contentBlacklist)</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1065,6 +1065,6 @@
|
|||||||
<string name="update_book_fail">更新失败</string>
|
<string name="update_book_fail">更新失败</string>
|
||||||
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
|
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
|
||||||
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
|
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
|
||||||
<string name="content_whitelist">白名单(contentWhitelist)</string>
|
<string name="c_whitelist">白名单(contentWhitelist)</string>
|
||||||
<string name="content_blacklist">黑名单(contentBlacklist)</string>
|
<string name="c_blacklist">黑名单(contentBlacklist)</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1067,6 +1067,6 @@
|
|||||||
<string name="update_book_fail">更新失败</string>
|
<string name="update_book_fail">更新失败</string>
|
||||||
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
|
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
|
||||||
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
|
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
|
||||||
<string name="content_whitelist">白名单(contentWhitelist)</string>
|
<string name="c_whitelist">白名单(contentWhitelist)</string>
|
||||||
<string name="content_blacklist">黑名单(contentBlacklist)</string>
|
<string name="c_blacklist">黑名单(contentBlacklist)</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1067,6 +1067,6 @@
|
|||||||
<string name="update_book_fail">更新失败</string>
|
<string name="update_book_fail">更新失败</string>
|
||||||
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
|
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
|
||||||
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
|
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
|
||||||
<string name="content_whitelist">白名单(contentWhitelist)</string>
|
<string name="c_whitelist">白名单(contentWhitelist)</string>
|
||||||
<string name="content_blacklist">黑名单(contentBlacklist)</string>
|
<string name="c_blacklist">黑名单(contentBlacklist)</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1068,6 +1068,6 @@
|
|||||||
<string name="update_book_fail">Update failed</string>
|
<string name="update_book_fail">Update failed</string>
|
||||||
<string name="notification_permission_rationale">Reading requires sending notifications to show reading control and download progress</string>
|
<string name="notification_permission_rationale">Reading requires sending notifications to show reading control and download progress</string>
|
||||||
<string name="webdav_after_local_restore_confirm">The webDav book source is newer than the local one, whether to restore it or not</string>
|
<string name="webdav_after_local_restore_confirm">The webDav book source is newer than the local one, whether to restore it or not</string>
|
||||||
<string name="content_whitelist">白名单(contentWhitelist)</string>
|
<string name="c_whitelist">白名单(contentWhitelist)</string>
|
||||||
<string name="content_blacklist">黑名单(contentBlacklist)</string>
|
<string name="c_blacklist">黑名单(contentBlacklist)</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user