Skip to content

Forms: fix title padding #382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.Divider
import androidx.compose.material3.LinearProgressIndicator
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand All @@ -48,8 +49,6 @@ import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.arcgismaps.mapping.featureforms.ComboBoxFormInput
import com.arcgismaps.mapping.featureforms.DateTimePickerFormInput
Expand Down Expand Up @@ -169,9 +168,13 @@ internal fun FeatureForm(
}

@Composable
private fun FeatureFormTitle(featureForm: FeatureForm) {
private fun FeatureFormTitle(featureForm: FeatureForm, modifier: Modifier = Modifier) {
val title by featureForm.title.collectAsState()
Text(text = title, style = TextStyle(fontWeight = FontWeight.Bold))
Text(
text = title,
style = MaterialTheme.typography.titleMedium,
modifier = modifier
)
}

@Composable
Expand All @@ -187,7 +190,10 @@ private fun FeatureFormBody(
horizontalAlignment = Alignment.CenterHorizontally
) {
// title
FeatureFormTitle(featureForm = form)
FeatureFormTitle(
featureForm = form,
modifier = Modifier.padding(horizontal = 15.dp)
)
Spacer(
modifier = Modifier
.fillMaxWidth()
Expand Down