add options

pull/394/head
AndyBernie 4 years ago
parent 5584a22637
commit 273d465e08
  1. 1
      app/src/main/java/io/legado/app/constant/PreferKey.kt
  2. 6
      app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceDialog.kt
  3. 4
      app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceViewModel.kt
  4. 6
      app/src/main/res/menu/change_source.xml
  5. 1
      app/src/main/res/values-zh-rHK/strings.xml
  6. 1
      app/src/main/res/values-zh-rTW/strings.xml
  7. 1
      app/src/main/res/values-zh/strings.xml
  8. 1
      app/src/main/res/values/strings.xml

@ -35,6 +35,7 @@ object PreferKey {
const val webDavCreateDir = "webDavCreateDir" const val webDavCreateDir = "webDavCreateDir"
const val webDavCacheBackup = "webDavCacheBackup" const val webDavCacheBackup = "webDavCacheBackup"
const val changeSourceLoadToc = "changeSourceLoadToc" const val changeSourceLoadToc = "changeSourceLoadToc"
const val changeSourceLoadInfo = "changeSourceLoadInfo"
const val chineseConverterType = "chineseConverterType" const val chineseConverterType = "chineseConverterType"
const val launcherIcon = "launcherIcon" const val launcherIcon = "launcherIcon"
const val textSelectAble = "selectText" const val textSelectAble = "selectText"

@ -88,6 +88,8 @@ class ChangeSourceDialog : BaseDialogFragment(),
tool_bar.setOnMenuItemClickListener(this) tool_bar.setOnMenuItemClickListener(this)
tool_bar.menu.findItem(R.id.menu_load_toc)?.isChecked = tool_bar.menu.findItem(R.id.menu_load_toc)?.isChecked =
getPrefBoolean(PreferKey.changeSourceLoadToc) getPrefBoolean(PreferKey.changeSourceLoadToc)
tool_bar.menu.findItem(R.id.menu_load_info)?.isChecked =
getPrefBoolean(PreferKey.changeSourceLoadInfo)
} }
private fun initRecyclerView() { private fun initRecyclerView() {
@ -159,6 +161,10 @@ class ChangeSourceDialog : BaseDialogFragment(),
putPrefBoolean(PreferKey.changeSourceLoadToc, !item.isChecked) putPrefBoolean(PreferKey.changeSourceLoadToc, !item.isChecked)
item.isChecked = !item.isChecked item.isChecked = !item.isChecked
} }
R.id.menu_load_info -> {
putPrefBoolean(PreferKey.changeSourceLoadInfo, !item.isChecked)
item.isChecked = !item.isChecked
}
R.id.menu_stop -> viewModel.stopSearch() R.id.menu_stop -> viewModel.stopSearch()
} }
return false return false

@ -121,7 +121,9 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio
it.forEach { searchBook -> it.forEach { searchBook ->
if (searchBook.name == name && searchBook.author == author) { if (searchBook.name == name && searchBook.author == author) {
if (searchBook.latestChapterTitle.isNullOrEmpty()) { if (searchBook.latestChapterTitle.isNullOrEmpty()) {
loadBookInfo(searchBook.toBook()) if (context.getPrefBoolean(PreferKey.changeSourceLoadInfo)) {
loadBookInfo(searchBook.toBook())
}
} else { } else {
searchFinish(searchBook) searchFinish(searchBook)
} }

@ -24,4 +24,10 @@
android:checkable="true" android:checkable="true"
app:showAsAction="never" /> app:showAsAction="never" />
<item
android:id="@+id/menu_load_info"
android:title="@string/load_info"
android:checkable="true"
app:showAsAction="never" />
</menu> </menu>

@ -568,6 +568,7 @@
<string name="export_selection">導出所選</string> <string name="export_selection">導出所選</string>
<string name="export">導出</string> <string name="export">導出</string>
<string name="load_toc">加載目錄</string> <string name="load_toc">加載目錄</string>
<string name="load_info">加載詳情頁</string>
<string name="tts">TTS</string> <string name="tts">TTS</string>
<string name="web_dav_pw">WebDav 密碼</string> <string name="web_dav_pw">WebDav 密碼</string>
<string name="web_dav_pw_s">輸入你的 WebDav 授權密碼</string> <string name="web_dav_pw_s">輸入你的 WebDav 授權密碼</string>

@ -569,6 +569,7 @@
<string name="export_selection">匯出所選</string> <string name="export_selection">匯出所選</string>
<string name="export">匯出</string> <string name="export">匯出</string>
<string name="load_toc">載入目錄</string> <string name="load_toc">載入目錄</string>
<string name="load_info">載入詳情頁</string>
<string name="tts">TTS</string> <string name="tts">TTS</string>
<string name="web_dav_pw">WebDav 密碼</string> <string name="web_dav_pw">WebDav 密碼</string>
<string name="web_dav_pw_s">輸入你的WebDav授權密碼</string> <string name="web_dav_pw_s">輸入你的WebDav授權密碼</string>

@ -575,6 +575,7 @@
<string name="export_selection">导出所选</string> <string name="export_selection">导出所选</string>
<string name="export">导出</string> <string name="export">导出</string>
<string name="load_toc">加载目录</string> <string name="load_toc">加载目录</string>
<string name="load_info">加载详情页</string>
<string name="tts">TTS</string> <string name="tts">TTS</string>
<string name="web_dav_pw">WebDav 密码</string> <string name="web_dav_pw">WebDav 密码</string>
<string name="web_dav_pw_s">输入你的WebDav授权密码</string> <string name="web_dav_pw_s">输入你的WebDav授权密码</string>

@ -577,6 +577,7 @@
<string name="export_selection">Export selected</string> <string name="export_selection">Export selected</string>
<string name="export">Export</string> <string name="export">Export</string>
<string name="load_toc">Load chapters</string> <string name="load_toc">Load chapters</string>
<string name="load_info">Load book detail</string>
<string name="tts">TTS</string> <string name="tts">TTS</string>
<string name="web_dav_pw">WebDav password</string> <string name="web_dav_pw">WebDav password</string>
<string name="web_dav_pw_s">Input you WebDav authorized password</string> <string name="web_dav_pw_s">Input you WebDav authorized password</string>

Loading…
Cancel
Save