@@ -6,6 +6,7 @@ import androidx.compose.runtime.Composable
66import androidx.compose.ui.Modifier
77import androidx.compose.ui.res.colorResource
88import androidx.compose.ui.res.stringArrayResource
9+ import androidx.compose.ui.text.ParagraphStyle
910import androidx.compose.ui.text.SpanStyle
1011import androidx.compose.ui.text.TextStyle
1112import androidx.compose.ui.text.buildAnnotatedString
@@ -20,6 +21,7 @@ import org.wordpress.android.ui.compose.theme.AppTheme
2021import org.wordpress.android.util.extensions.isOdd
2122
2223private val fontSize = 40 .sp
24+ private val lineHeight = fontSize / 100 * 105 // last value = % of fontSize
2325
2426@Composable
2527private fun LargeTexts () {
@@ -30,16 +32,15 @@ private fun LargeTexts() {
3032
3133 val styledText = buildAnnotatedString {
3234 texts.forEachIndexed { index, text ->
33- when ((index + 1 ).isOdd) {
34- true -> withStyle(SpanStyle (color = secondaryColor)) {
35- append(text)
35+ withStyle(ParagraphStyle (lineHeight = lineHeight)) {
36+ when ((index + 1 ).isOdd) {
37+ true -> withStyle(SpanStyle (color = secondaryColor)) {
38+ append(text)
39+ }
40+ false -> withStyle(SpanStyle (color = primaryColor)) {
41+ append(text)
42+ }
3643 }
37- false -> withStyle(SpanStyle (color = primaryColor)) {
38- append(text)
39- }
40- }
41- if (index != texts.lastIndex) {
42- append(" \n " )
4344 }
4445 }
4546 }
0 commit comments