|
|
@ -4,6 +4,7 @@ import android.text.Layout |
|
|
|
import android.text.StaticLayout |
|
|
|
import android.text.StaticLayout |
|
|
|
import io.legado.app.App |
|
|
|
import io.legado.app.App |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.R |
|
|
|
|
|
|
|
import io.legado.app.help.ReadBookConfig |
|
|
|
import io.legado.app.ui.book.read.page.ChapterProvider |
|
|
|
import io.legado.app.ui.book.read.page.ChapterProvider |
|
|
|
import java.text.DecimalFormat |
|
|
|
import java.text.DecimalFormat |
|
|
|
|
|
|
|
|
|
|
@ -19,6 +20,7 @@ data class TextPage( |
|
|
|
) { |
|
|
|
) { |
|
|
|
|
|
|
|
|
|
|
|
fun upLinesPosition() = ChapterProvider.apply { |
|
|
|
fun upLinesPosition() = ChapterProvider.apply { |
|
|
|
|
|
|
|
if (!ReadBookConfig.textBottomJustify) return@apply |
|
|
|
if (textLines.size <= 1) return@apply |
|
|
|
if (textLines.size <= 1) return@apply |
|
|
|
if (visibleHeight - height >= with(textLines.last()) { lineBottom - lineTop }) return@apply |
|
|
|
if (visibleHeight - height >= with(textLines.last()) { lineBottom - lineTop }) return@apply |
|
|
|
val surplus = (visibleBottom - textLines.last().lineBottom) |
|
|
|
val surplus = (visibleBottom - textLines.last().lineBottom) |
|
|
|