diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt index 6fb4ce101..169b184ab 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt @@ -359,7 +359,7 @@ object ChapterProvider { } var height = size.height var width = size.width - when (imageStyle?.toUpperCase(Locale.ROOT)) { + when (imageStyle?.uppercase(Locale.ROOT)) { Book.imgStyleFull -> { width = visibleWidth height = size.height * visibleWidth / size.width diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/TextChapterLayout.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/TextChapterLayout.kt index 197c64990..7e1f57208 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/TextChapterLayout.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/TextChapterLayout.kt @@ -495,23 +495,8 @@ class TextChapterLayout( isTitle && textPages.isEmpty() && pendingTextPage.lines.isEmpty() -> { when (imageStyle?.uppercase(Locale.ROOT)) { Book.imgStyleSingle -> { - val textPage = pendingTextPage - if (textPage.lineSize == 0) { - val ty = (visibleHeight - layout.lineCount * textHeight) / 2 - if (ty > titleTopSpacing) ty else titleTopSpacing.toFloat() - } else { - var textLayoutHeight = layout.lineCount * textHeight - val fistLine = textPage.getLine(0) - if (fistLine.lineTop < textLayoutHeight + titleTopSpacing) { - textLayoutHeight = fistLine.lineTop - titleTopSpacing - } - textPage.lines.forEach { - it.lineTop -= textLayoutHeight - it.lineBase -= textLayoutHeight - it.lineBottom -= textLayoutHeight - } - y - textLayoutHeight - } + val ty = (visibleHeight - layout.lineCount * textHeight) / 2 + if (ty > titleTopSpacing) ty else titleTopSpacing.toFloat() } else -> y + titleTopSpacing @@ -567,7 +552,7 @@ class TextChapterLayout( //标题x轴居中 val startX = if ( isTitle && - (ReadBookConfig.isMiddleTitle || emptyContent || isVolumeTitle || imageStyle == "SINGLE") + (ReadBookConfig.isMiddleTitle || emptyContent || isVolumeTitle || imageStyle == Book.imgStyleSingle) ) { (visibleWidth - desiredWidth) / 2 } else { @@ -582,7 +567,7 @@ class TextChapterLayout( else -> { if ( isTitle && - (ReadBookConfig.isMiddleTitle || emptyContent || isVolumeTitle || imageStyle == "SINGLE") + (ReadBookConfig.isMiddleTitle || emptyContent || isVolumeTitle || imageStyle == Book.imgStyleSingle) ) { //标题居中 val startX = (visibleWidth - desiredWidth) / 2 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 139ecb53c..18b74bb9e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -43,7 +43,9 @@ desugar = "2.0.4" activity = "1.9.1" kotlinxSerialization = "1.7.1" swiperefreshlayout = "1.1.0" +#noinspection GradleDependency recyclerview = "1.2.0" +#noinspection GradleDependency viewpager2 = "1.0.0" webkit = "1.11.0" zxingLite = "3.2.0"