Fixed: With ParagraphIndentation on, text does not show correctly. (v1.0.1)
This commit is contained in:
parent
ebf86229d0
commit
8ecdbfbc84
1 changed files with 8 additions and 14 deletions
|
|
@ -23,7 +23,6 @@ import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.State
|
import androidx.compose.runtime.State
|
||||||
import androidx.compose.runtime.derivedStateOf
|
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
|
@ -82,19 +81,10 @@ fun LazyItemScope.ReaderTextParagraph(
|
||||||
onEvent: (ReaderEvent) -> Unit
|
onEvent: (ReaderEvent) -> Unit
|
||||||
) {
|
) {
|
||||||
val text = remember(
|
val text = remember(
|
||||||
paragraphIndentation,
|
line.useTranslation, line.translatedLine, line.originalLine
|
||||||
line.originalLine,
|
|
||||||
line.translatedLine,
|
|
||||||
line.useTranslation,
|
|
||||||
line.translatingTo,
|
|
||||||
line.translatingFrom
|
|
||||||
) {
|
) {
|
||||||
derivedStateOf {
|
if (line.useTranslation && line.translatedLine != null) line.translatedLine
|
||||||
if (paragraphIndentation) " "
|
else line.originalLine
|
||||||
else "" +
|
|
||||||
if (line.useTranslation && line.translatedLine != null) line.translatedLine
|
|
||||||
else line.originalLine
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val translated = remember(line.useTranslation, line.translatedLine) {
|
val translated = remember(line.useTranslation, line.translatedLine) {
|
||||||
|
|
@ -158,7 +148,11 @@ fun LazyItemScope.ReaderTextParagraph(
|
||||||
|
|
||||||
BasicText(
|
BasicText(
|
||||||
text = buildAnnotatedString {
|
text = buildAnnotatedString {
|
||||||
append(text.value)
|
if (paragraphIndentation) {
|
||||||
|
append(" ")
|
||||||
|
}
|
||||||
|
|
||||||
|
append(text)
|
||||||
|
|
||||||
if (showTrailingContent) {
|
if (showTrailingContent) {
|
||||||
append(" ")
|
append(" ")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue