Improve ListItem logical item grouping

This commit is contained in:
Marco Romano 2023-09-13 10:25:30 +02:00
parent 47f030cffe
commit 55f51a01a0

View file

@ -18,6 +18,7 @@ package io.element.android.features.poll.impl.create
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
@ -110,13 +111,12 @@ fun CreatePollView(
.fillMaxSize(),
) {
item {
Column {
Text(
text = stringResource(id = R.string.screen_create_poll_question_desc),
modifier = Modifier.padding(start = 32.dp),
style = ElementTheme.typography.fontBodyMdRegular,
)
}
item {
ListItem(
headlineContent = {
OutlinedTextField(
@ -135,6 +135,7 @@ fun CreatePollView(
}
)
}
}
itemsIndexed(state.answers) { index, answer ->
ListItem(
headlineContent = {
@ -175,9 +176,8 @@ fun CreatePollView(
}
}
item {
Column {
HorizontalDivider()
}
item {
ListItem(
headlineContent = { Text(text = stringResource(id = R.string.screen_create_poll_anonymous_headline)) },
supportingContent = { Text(text = stringResource(id = R.string.screen_create_poll_anonymous_desc)) },
@ -189,6 +189,7 @@ fun CreatePollView(
}
}
}
}
}
@DayNightPreviews