This commit is contained in:
Horis 2024-05-22 10:34:26 +08:00
parent 27571f5b06
commit a2cc621917
4 changed files with 9 additions and 6 deletions

View File

@ -303,9 +303,7 @@ class ReadBookActivity : BaseReadBookActivity(),
if (bookChanged) {
bookChanged = false
ReadBook.callBack = this
viewModel.initData(intent) {
upMenu()
}
viewModel.initData(intent)
} else {
//web端阅读时app处于阅读界面本地记录会覆盖web保存的进度在此处恢复
ReadBook.webBookProgress?.let {

View File

@ -159,6 +159,7 @@ class MoreConfigDialog : DialogFragment() {
}
PreferKey.optimizeRender -> {
ChapterProvider.upStyle()
ReadBook.callBack?.upPageAnim(true)
ReadBook.loadContent(false)
}

View File

@ -200,7 +200,7 @@ class ReadStyleDialog : BaseDialogFragment(R.layout.dialog_read_book_style),
override fun selectFont(path: String) {
if (path != ReadBookConfig.textFont) {
ReadBookConfig.textFont = path
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
postEvent(EventBus.UP_CONFIG, arrayListOf(2, 5))
}
}

View File

@ -881,7 +881,9 @@ object ChapterProvider {
tPaint.typeface = titleFont
tPaint.textSize = with(ReadBookConfig) { textSize + titleSize }.toFloat().spToPx()
tPaint.isAntiAlias = true
tPaint.isLinearText = true
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.Q && AppConfig.optimizeRender) {
tPaint.isLinearText = true
}
//正文
val cPaint = TextPaint()
cPaint.color = ReadBookConfig.textColor
@ -889,7 +891,9 @@ object ChapterProvider {
cPaint.typeface = textFont
cPaint.textSize = ReadBookConfig.textSize.toFloat().spToPx()
cPaint.isAntiAlias = true
cPaint.isLinearText = true
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.Q && AppConfig.optimizeRender) {
cPaint.isLinearText = true
}
return Pair(tPaint, cPaint)
}