mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
f04670dc88
commit
39ce4cdf89
@ -23,10 +23,18 @@ import io.legado.app.ui.book.read.page.entities.TextPage
|
|||||||
import io.legado.app.ui.book.read.page.entities.column.ImageColumn
|
import io.legado.app.ui.book.read.page.entities.column.ImageColumn
|
||||||
import io.legado.app.ui.book.read.page.entities.column.ReviewColumn
|
import io.legado.app.ui.book.read.page.entities.column.ReviewColumn
|
||||||
import io.legado.app.ui.book.read.page.entities.column.TextColumn
|
import io.legado.app.ui.book.read.page.entities.column.TextColumn
|
||||||
import io.legado.app.utils.*
|
import io.legado.app.utils.RealPathUtil
|
||||||
|
import io.legado.app.utils.dpToPx
|
||||||
|
import io.legado.app.utils.isContentScheme
|
||||||
|
import io.legado.app.utils.isPad
|
||||||
|
import io.legado.app.utils.postEvent
|
||||||
|
import io.legado.app.utils.spToPx
|
||||||
|
import io.legado.app.utils.splitNotBlank
|
||||||
|
import io.legado.app.utils.textHeight
|
||||||
|
import io.legado.app.utils.toStringArray
|
||||||
import splitties.init.appCtx
|
import splitties.init.appCtx
|
||||||
import java.util.*
|
import java.util.LinkedList
|
||||||
import kotlin.collections.ArrayList
|
import java.util.Locale
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解析内容生成章节和页面
|
* 解析内容生成章节和页面
|
||||||
@ -627,8 +635,8 @@ object ChapterProvider {
|
|||||||
textPaint: TextPaint
|
textPaint: TextPaint
|
||||||
): Pair<List<String>, List<Float>> {
|
): Pair<List<String>, List<Float>> {
|
||||||
val charArray = text.toCharArray()
|
val charArray = text.toCharArray()
|
||||||
val strList = ArrayList<String>()
|
val strList = ArrayList<String>(text.length)
|
||||||
val textWidthList = ArrayList<Float>()
|
val textWidthList = ArrayList<Float>(text.length)
|
||||||
val lastIndex = charArray.lastIndex
|
val lastIndex = charArray.lastIndex
|
||||||
var ca: CharArray? = null
|
var ca: CharArray? = null
|
||||||
for (i in textWidths.indices) {
|
for (i in textWidths.indices) {
|
||||||
|
Loading…
Reference in New Issue
Block a user