Bugfix : MultiParagraphLayoutCache - Fatal Exception: java.lang.IllegalStateException
FlowRow seems to not like to be selected and scrolled at the same time since compose 1.5.3. https://console.firebase.google.com/u/0/project/rp-lexicon/crashlytics/app/android:com.pixelized.rplexicon/issues/1684dc9334d5d5b9b062129ab75016c2?hl=fr&time=last-seven-days&types=crash&sessionEventKey=6550F66A03A50001351A80EA05E2DB95_1879051561740631814
This commit is contained in:
parent
27332999d9
commit
0d81f72635
2 changed files with 52 additions and 58 deletions
|
|
@ -6,8 +6,8 @@ import androidx.annotation.StringRes
|
|||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
||||
import androidx.compose.foundation.layout.FlowRow
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
|
|
@ -64,7 +64,6 @@ data class LexiconItemUio(
|
|||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalLayoutApi::class)
|
||||
@Composable
|
||||
fun LexiconItem(
|
||||
modifier: Modifier = Modifier,
|
||||
|
|
@ -77,79 +76,73 @@ fun LexiconItem(
|
|||
contentAlignment = Alignment.CenterStart,
|
||||
) {
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(space = 4.dp),
|
||||
) {
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.padding(end = 4.dp)
|
||||
.alignByBaseline()
|
||||
.placeholder { item.placeholder },
|
||||
style = typography.base.titleMedium,
|
||||
text = if (item.isPlayingCharacter) LOS_FULL else LOS_HOLLOW,
|
||||
)
|
||||
|
||||
FlowRow(
|
||||
modifier = Modifier.alignByBaseline(),
|
||||
horizontalArrangement = Arrangement.spacedBy(4.dp),
|
||||
) {
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.alignByBaseline()
|
||||
.placeholder { item.placeholder },
|
||||
style = typography.base.titleMedium,
|
||||
fontWeight = FontWeight.Bold,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
text = AnnotatedString(
|
||||
text = item.name,
|
||||
spanStyles = when (item.placeholder) {
|
||||
true -> emptyList()
|
||||
else -> listOf(
|
||||
AnnotatedString.Range(
|
||||
item = typography.titleMediumDropCap,
|
||||
start = 0,
|
||||
end = 1,
|
||||
)
|
||||
)
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
item.diminutive?.let {
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.alignByBaseline()
|
||||
.placeholder { item.placeholder },
|
||||
style = typography.base.titleMedium,
|
||||
fontWeight = FontWeight.Bold,
|
||||
style = typography.base.labelMedium,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
text = AnnotatedString(
|
||||
text = item.name,
|
||||
spanStyles = when (item.placeholder) {
|
||||
true -> emptyList()
|
||||
else -> listOf(
|
||||
AnnotatedString.Range(
|
||||
item = typography.titleMediumDropCap,
|
||||
start = 0,
|
||||
end = 1,
|
||||
)
|
||||
)
|
||||
},
|
||||
),
|
||||
text = it,
|
||||
)
|
||||
|
||||
item.diminutive?.let {
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.alignByBaseline()
|
||||
.placeholder { item.placeholder },
|
||||
style = typography.base.labelMedium,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
text = it,
|
||||
)
|
||||
}
|
||||
|
||||
Row(
|
||||
modifier = Modifier.alignByBaseline(),
|
||||
horizontalArrangement = Arrangement.spacedBy(4.dp),
|
||||
) {
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.alignByBaseline()
|
||||
.placeholder { item.placeholder },
|
||||
style = typography.base.labelMedium,
|
||||
fontStyle = FontStyle.Italic,
|
||||
maxLines = 1,
|
||||
text = stringResource(id = item.gender)
|
||||
)
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.alignByBaseline()
|
||||
.placeholder { item.placeholder },
|
||||
style = typography.base.labelMedium,
|
||||
fontStyle = FontStyle.Italic,
|
||||
maxLines = 1,
|
||||
text = stringResource(id = item.race)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.alignByBaseline()
|
||||
.placeholder { item.placeholder },
|
||||
style = typography.base.labelMedium,
|
||||
fontStyle = FontStyle.Italic,
|
||||
fontWeight = FontWeight.Light,
|
||||
maxLines = 1,
|
||||
text = stringResource(id = item.gender)
|
||||
)
|
||||
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.alignByBaseline()
|
||||
.placeholder { item.placeholder },
|
||||
style = typography.base.labelMedium,
|
||||
fontStyle = FontStyle.Italic,
|
||||
fontWeight = FontWeight.Light,
|
||||
maxLines = 1,
|
||||
text = stringResource(id = item.race)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
|||
import androidx.compose.ui.unit.dp
|
||||
import com.pixelized.rplexicon.ui.theme.LexiconTheme
|
||||
import com.pixelized.rplexicon.utilitary.LOS_HOLLOW
|
||||
import com.pixelized.rplexicon.utilitary.annotateWithDropCap
|
||||
import com.pixelized.rplexicon.utilitary.extentions.cell
|
||||
import com.pixelized.rplexicon.utilitary.extentions.lexicon
|
||||
import com.pixelized.rplexicon.utilitary.extentions.placeholder
|
||||
Loading…
Add table
Add a link
Reference in a new issue