Fix questItem spacing.

This commit is contained in:
Thomas Andres Gomez 2023-08-02 09:57:35 +02:00
parent 0fe6fe6a33
commit b17eefac39

View file

@ -2,6 +2,7 @@ package com.pixelized.rplexicon.ui.screens.quest.list
import android.content.res.Configuration
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
@ -52,39 +53,42 @@ fun QuestItem(
) {
val typography = MaterialTheme.lexicon.typography
Row(
Box(
modifier = modifier,
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp),
contentAlignment = Alignment.CenterStart,
) {
Text(
modifier = when (item.placeholder) {
true -> Modifier.placeholder { true }
else -> Modifier.alignByBaseline()
},
text = if (item.complete) "" else "",
)
Text(
modifier = when (item.placeholder) {
true -> Modifier.placeholder { true }
else -> Modifier.alignByBaseline()
},
text = remember(item.placeholder) {
AnnotatedString(
text = item.title,
spanStyles = when (item.placeholder) {
true -> emptyList()
else -> listOf(
AnnotatedString.Range(
item = typography.dropCapMediumSpan,
start = 0,
end = 1,
Row(
horizontalArrangement = Arrangement.spacedBy(8.dp),
) {
Text(
modifier = when (item.placeholder) {
true -> Modifier.placeholder { true }
else -> Modifier.alignByBaseline()
},
text = if (item.complete) "" else "",
)
Text(
modifier = when (item.placeholder) {
true -> Modifier.placeholder { true }
else -> Modifier.alignByBaseline()
},
text = remember(item.placeholder) {
AnnotatedString(
text = item.title,
spanStyles = when (item.placeholder) {
true -> emptyList()
else -> listOf(
AnnotatedString.Range(
item = typography.dropCapMediumSpan,
start = 0,
end = 1,
)
)
)
},
)
},
)
},
)
},
)
}
}
}