|
@@ -34,7 +34,6 @@ import kotlinx.coroutines.channels.Channel
|
|
|
import kotlinx.coroutines.ensureActive
|
|
import kotlinx.coroutines.ensureActive
|
|
|
import kotlinx.coroutines.launch
|
|
import kotlinx.coroutines.launch
|
|
|
import java.util.LinkedList
|
|
import java.util.LinkedList
|
|
|
-import java.util.Locale
|
|
|
|
|
import kotlin.coroutines.coroutineContext
|
|
import kotlin.coroutines.coroutineContext
|
|
|
import kotlin.math.roundToInt
|
|
import kotlin.math.roundToInt
|
|
|
|
|
|
|
@@ -339,7 +338,7 @@ class TextChapterLayout(
|
|
|
}
|
|
}
|
|
|
var height = size.height
|
|
var height = size.height
|
|
|
var width = size.width
|
|
var width = size.width
|
|
|
- when (imageStyle?.uppercase(Locale.ROOT)) {
|
|
|
|
|
|
|
+ when (imageStyle?.uppercase()) {
|
|
|
Book.imgStyleFull -> {
|
|
Book.imgStyleFull -> {
|
|
|
width = visibleWidth
|
|
width = visibleWidth
|
|
|
height = size.height * visibleWidth / size.width
|
|
height = size.height * visibleWidth / size.width
|
|
@@ -487,7 +486,7 @@ class TextChapterLayout(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
isTitle && textPages.isEmpty() && pendingTextPage.lines.isEmpty() -> {
|
|
isTitle && textPages.isEmpty() && pendingTextPage.lines.isEmpty() -> {
|
|
|
- when (imageStyle?.uppercase(Locale.ROOT)) {
|
|
|
|
|
|
|
+ when (imageStyle?.uppercase()) {
|
|
|
Book.imgStyleSingle -> {
|
|
Book.imgStyleSingle -> {
|
|
|
val ty = (visibleHeight - layout.lineCount * textHeight) / 2
|
|
val ty = (visibleHeight - layout.lineCount * textHeight) / 2
|
|
|
if (ty > titleTopSpacing) ty else titleTopSpacing.toFloat()
|
|
if (ty > titleTopSpacing) ty else titleTopSpacing.toFloat()
|
|
@@ -546,7 +545,8 @@ class TextChapterLayout(
|
|
|
//标题x轴居中
|
|
//标题x轴居中
|
|
|
val startX = if (
|
|
val startX = if (
|
|
|
isTitle &&
|
|
isTitle &&
|
|
|
- (ReadBookConfig.isMiddleTitle || emptyContent || isVolumeTitle || imageStyle == Book.imgStyleSingle)
|
|
|
|
|
|
|
+ (ReadBookConfig.isMiddleTitle || emptyContent || isVolumeTitle
|
|
|
|
|
+ || imageStyle?.uppercase() == Book.imgStyleSingle)
|
|
|
) {
|
|
) {
|
|
|
(visibleWidth - desiredWidth) / 2
|
|
(visibleWidth - desiredWidth) / 2
|
|
|
} else {
|
|
} else {
|
|
@@ -561,7 +561,8 @@ class TextChapterLayout(
|
|
|
else -> {
|
|
else -> {
|
|
|
if (
|
|
if (
|
|
|
isTitle &&
|
|
isTitle &&
|
|
|
- (ReadBookConfig.isMiddleTitle || emptyContent || isVolumeTitle || imageStyle == Book.imgStyleSingle)
|
|
|
|
|
|
|
+ (ReadBookConfig.isMiddleTitle || emptyContent || isVolumeTitle
|
|
|
|
|
+ || imageStyle?.uppercase() == Book.imgStyleSingle)
|
|
|
) {
|
|
) {
|
|
|
//标题居中
|
|
//标题居中
|
|
|
val startX = (visibleWidth - desiredWidth) / 2
|
|
val startX = (visibleWidth - desiredWidth) / 2
|