Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Jan 2, 2025
1 parent 3362169 commit 0fa0645
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions app/src/main/assets/defaultData/coverRule.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"enable": true,
"searchUrl": "https://api.yousuu.com/api/search?type=title&value={{key}}&page=1&highlight=0&from=search",
"coverRule": "@js:java.getString(\"$..books[?(@.author == '\" + book.author + \"')].cover\")"
"enable": false,
"searchUrl": "",
"coverRule": ""
}
2 changes: 1 addition & 1 deletion app/src/main/assets/defaultData/directLinkUpload.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{
"uploadUrl": "http://v2.jt12.eu/up-v2.php,{\"method\":\"POST\",\"body\": {\"file\": \"fileRequest\"},\"type\": \"multipart/form-data\"}",
"downloadUrlRule": "$.msg",
"summary": "橘涂网盘·过于卡顿,如非需要永久链接。否则不建议使用(永久有效)",
"summary": "橘涂书源网盘2.0 Beta(永久有效)",
"compress": false
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.ensureActive
import kotlinx.coroutines.launch
import java.util.LinkedList
import java.util.Locale
import kotlin.coroutines.coroutineContext
import kotlin.math.roundToInt

Expand Down Expand Up @@ -339,7 +338,7 @@ class TextChapterLayout(
}
var height = size.height
var width = size.width
when (imageStyle?.uppercase(Locale.ROOT)) {
when (imageStyle?.uppercase()) {
Book.imgStyleFull -> {
width = visibleWidth
height = size.height * visibleWidth / size.width
Expand Down Expand Up @@ -487,7 +486,7 @@ class TextChapterLayout(
}

isTitle && textPages.isEmpty() && pendingTextPage.lines.isEmpty() -> {
when (imageStyle?.uppercase(Locale.ROOT)) {
when (imageStyle?.uppercase()) {
Book.imgStyleSingle -> {
val ty = (visibleHeight - layout.lineCount * textHeight) / 2
if (ty > titleTopSpacing) ty else titleTopSpacing.toFloat()
Expand Down Expand Up @@ -546,7 +545,8 @@ class TextChapterLayout(
//标题x轴居中
val startX = if (
isTitle &&
(ReadBookConfig.isMiddleTitle || emptyContent || isVolumeTitle || imageStyle == Book.imgStyleSingle)
(ReadBookConfig.isMiddleTitle || emptyContent || isVolumeTitle
|| imageStyle?.uppercase() == Book.imgStyleSingle)
) {
(visibleWidth - desiredWidth) / 2
} else {
Expand All @@ -561,7 +561,8 @@ class TextChapterLayout(
else -> {
if (
isTitle &&
(ReadBookConfig.isMiddleTitle || emptyContent || isVolumeTitle || imageStyle == Book.imgStyleSingle)
(ReadBookConfig.isMiddleTitle || emptyContent || isVolumeTitle
|| imageStyle?.uppercase() == Book.imgStyleSingle)
) {
//标题居中
val startX = (visibleWidth - desiredWidth) / 2
Expand Down

0 comments on commit 0fa0645

Please sign in to comment.