Merge pull request #1574 from Xwite/master

校验设置可在校验书源时更改;更新SelectActionBar.kt
This commit is contained in:
kunfei 2022-02-01 23:05:33 +08:00 committed by GitHub
commit 1569b17866
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 15 additions and 18 deletions

View File

@ -80,6 +80,7 @@ data class BookChapter(
chineseConvert: Boolean = true,
): String {
var displayTitle = title.replace(AppPattern.rnRegex, "")
val mDisplayTitle = displayTitle
if (useReplace && replaceRules != null) {
replaceRules.forEach { item ->
if (item.pattern.isNotEmpty()) {
@ -95,6 +96,7 @@ data class BookChapter(
}
}
}
if (displayTitle.isBlank()) displayTitle = mDisplayTitle
if (chineseConvert) {
when (AppConfig.chineseConverterType) {
1 -> displayTitle = ChineseUtils.t2s(displayTitle)

View File

@ -77,10 +77,6 @@ class ContentProcessor private constructor(
//重新分段
mContent = ContentHelp.reSegment(mContent, chapter.title)
}
if (includeTitle) {
//重新添加标题
mContent = chapter.getDisplayTitle() + "\n" + mContent
}
if (useReplace && book.getUseReplaceRule()) {
//替换
mContent = replaceContent(mContent)
@ -96,6 +92,10 @@ class ContentProcessor private constructor(
appCtx.toastOnUi("简繁转换出错")
}
}
if (includeTitle) {
//重新添加标题
mContent = chapter.getDisplayTitle(getReplaceRules()) + "\n" + mContent
}
val contents = arrayListOf<String>()
mContent.split("\n").forEach { str ->
val paragraph = str.trim {
@ -131,4 +131,4 @@ class ContentProcessor private constructor(
return mContent
}
}
}

View File

@ -6,7 +6,6 @@ import io.legado.app.constant.IntentAction
import io.legado.app.data.entities.BookSource
import io.legado.app.service.CheckSourceService
import io.legado.app.utils.startService
import io.legado.app.utils.toastOnUi
import io.legado.app.help.CacheManager
import splitties.init.appCtx
@ -26,10 +25,6 @@ object CheckSource {
}
fun start(context: Context, sources: List<BookSource>) {
if (sources.isEmpty()) {
context.toastOnUi(R.string.non_select)
return
}
val selectedIds: ArrayList<String> = arrayListOf()
sources.map {
selectedIds.add(it.bookSourceUrl)

View File

@ -27,6 +27,7 @@ import io.legado.app.lib.theme.primaryTextColor
import io.legado.app.model.CheckSource
import io.legado.app.model.Debug
import io.legado.app.ui.association.ImportBookSourceDialog
import io.legado.app.ui.config.CheckSourceConfig
import io.legado.app.ui.book.local.rule.TxtTocRuleActivity
import io.legado.app.ui.book.source.debug.BookSourceDebugActivity
import io.legado.app.ui.book.source.edit.BookSourceEditActivity
@ -361,7 +362,11 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
CheckSource.start(this@BookSourceActivity, adapter.selection)
checkMessageRefreshJob().start()
}
noButton()
neutralButton(R.string.check_source_config) {
checkSource()
showDialogFragment<CheckSourceConfig>()
}
cancelButton()
}
}

View File

@ -100,6 +100,8 @@ class SelectActionBar @JvmOverloads constructor(
btnRevertSelection.isClickable = isClickable
btnSelectActionMain.isEnabled = isClickable
btnSelectActionMain.isClickable = isClickable
ivMenuMore.isEnabled = isClickable
ivMenuMore.isClickable = isClickable
}
interface CallBack {

View File

@ -259,7 +259,6 @@
<string name="text_bg_style">Color de fondo (mantén pulsado para personalizar)</string>
<string name="immersion_status_bar">Barra de estado inmersiva</string>
<string name="un_download">%d capítulo(s) restante(s)</string>
<string name="non_select">Ninguno seleccionado</string>
<string name="long_click_input_color">Mantén pulsado para introducir el valor de color</string>
<string name="loading">Cargando…</string>
<string name="group_zg">Preparando</string>

View File

@ -263,7 +263,6 @@
<string name="text_bg_style">Color and background (long tap to customize)</string>
<string name="immersion_status_bar">Immersive status bar</string>
<string name="un_download">%d chapter(s) left</string>
<string name="non_select">No selected</string>
<string name="long_click_input_color">Long tap to input color value</string>
<string name="loading">Loading…</string>
<string name="group_zg">Awaiting</string>

View File

@ -263,7 +263,6 @@
<string name="text_bg_style">Cor e fundo (toque longo para personalizar)</string>
<string name="immersion_status_bar">Barra de status imersiva</string>
<string name="un_download">%d capítulo(s) restante(s)</string>
<string name="non_select">Nenhum selecionado</string>
<string name="long_click_input_color">Clique longo, para introduzir o valor da cor</string>
<string name="loading">Carregando…</string>
<string name="group_zg">Aguardando</string>

View File

@ -260,7 +260,6 @@
<string name="text_bg_style">文字顏色和背景(長按自定義)</string>
<string name="immersion_status_bar">沉浸式狀態欄</string>
<string name="un_download">還剩 %d 章未下載</string>
<string name="non_select">仲未揀</string>
<string name="long_click_input_color">長按輸入顏色值</string>
<string name="loading">加載中…</string>
<string name="group_zg">追更區</string>

View File

@ -262,7 +262,6 @@
<string name="text_bg_style">文字顏色和背景(長按自訂)</string>
<string name="immersion_status_bar">沉浸式狀態欄</string>
<string name="un_download">還剩%d章未下載</string>
<string name="non_select">沒有選擇</string>
<string name="long_click_input_color">長按輸入顏色值</string>
<string name="loading">載入中…</string>
<string name="group_zg">追更區</string>

View File

@ -262,7 +262,6 @@
<string name="text_bg_style">文字颜色和背景(长按自定义)</string>
<string name="immersion_status_bar">沉浸式状态栏</string>
<string name="un_download">还剩%d章未下载</string>
<string name="non_select">没有选择</string>
<string name="long_click_input_color">长按输入颜色值</string>
<string name="loading">加载中…</string>
<string name="group_zg">追更区</string>

View File

@ -263,7 +263,6 @@
<string name="text_bg_style">Color and background (long tap to customize)</string>
<string name="immersion_status_bar">Immersive status bar</string>
<string name="un_download">%d chapter(s) left</string>
<string name="non_select">No selected</string>
<string name="long_click_input_color">Long tap to input color value</string>
<string name="loading">Loading…</string>
<string name="group_zg">Awaiting</string>