|
|
@ -14,7 +14,7 @@ import io.legado.app.help.config.AppConfig |
|
|
|
import io.legado.app.help.config.ReadBookConfig |
|
|
|
import io.legado.app.help.config.ReadBookConfig |
|
|
|
import io.legado.app.lib.theme.accentColor |
|
|
|
import io.legado.app.lib.theme.accentColor |
|
|
|
import io.legado.app.model.ReadBook |
|
|
|
import io.legado.app.model.ReadBook |
|
|
|
import io.legado.app.ui.book.read.page.entities.TextChar |
|
|
|
import io.legado.app.ui.book.read.page.entities.TextColumn |
|
|
|
import io.legado.app.ui.book.read.page.entities.TextLine |
|
|
|
import io.legado.app.ui.book.read.page.entities.TextLine |
|
|
|
import io.legado.app.ui.book.read.page.entities.TextPage |
|
|
|
import io.legado.app.ui.book.read.page.entities.TextPage |
|
|
|
import io.legado.app.ui.book.read.page.entities.TextPos |
|
|
|
import io.legado.app.ui.book.read.page.entities.TextPos |
|
|
@ -160,7 +160,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at |
|
|
|
} |
|
|
|
} |
|
|
|
val textColor = if (textLine.isReadAloud) context.accentColor else ReadBookConfig.textColor |
|
|
|
val textColor = if (textLine.isReadAloud) context.accentColor else ReadBookConfig.textColor |
|
|
|
textLine.textChars.forEach { |
|
|
|
textLine.textChars.forEach { |
|
|
|
if (it.isImage) { |
|
|
|
if (it.style == 1) { |
|
|
|
drawImage(canvas, textPage, textLine, it, lineTop, lineBottom) |
|
|
|
drawImage(canvas, textPage, textLine, it, lineTop, lineBottom) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
textPaint.color = textColor |
|
|
|
textPaint.color = textColor |
|
|
@ -183,7 +183,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at |
|
|
|
canvas: Canvas, |
|
|
|
canvas: Canvas, |
|
|
|
textPage: TextPage, |
|
|
|
textPage: TextPage, |
|
|
|
textLine: TextLine, |
|
|
|
textLine: TextLine, |
|
|
|
textChar: TextChar, |
|
|
|
textChar: TextColumn, |
|
|
|
lineTop: Float, |
|
|
|
lineTop: Float, |
|
|
|
lineBottom: Float |
|
|
|
lineBottom: Float |
|
|
|
) { |
|
|
|
) { |
|
|
@ -284,7 +284,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at |
|
|
|
select: (textPos: TextPos) -> Unit, |
|
|
|
select: (textPos: TextPos) -> Unit, |
|
|
|
) { |
|
|
|
) { |
|
|
|
touch(x, y) { _, textPos, _, _, textChar -> |
|
|
|
touch(x, y) { _, textPos, _, _, textChar -> |
|
|
|
if (textChar.isImage) { |
|
|
|
if (textChar.style == 1) { |
|
|
|
callBack.onImageLongPress(x, y, textChar.charData) |
|
|
|
callBack.onImageLongPress(x, y, textChar.charData) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (!selectAble) return@touch |
|
|
|
if (!selectAble) return@touch |
|
|
@ -367,7 +367,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at |
|
|
|
textPos: TextPos, |
|
|
|
textPos: TextPos, |
|
|
|
textPage: TextPage, |
|
|
|
textPage: TextPage, |
|
|
|
textLine: TextLine, |
|
|
|
textLine: TextLine, |
|
|
|
textChar: TextChar |
|
|
|
textColumn: TextColumn |
|
|
|
) -> Unit |
|
|
|
) -> Unit |
|
|
|
) { |
|
|
|
) { |
|
|
|
if (!visibleRect.contains(x, y)) return |
|
|
|
if (!visibleRect.contains(x, y)) return |
|
|
|