From de9956cbf7981e903def1a4a5b20c2424e3df243 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Mon, 6 May 2024 19:39:16 -0600 Subject: [PATCH] Fix padding on edit view --- .../simplemarkdown/ui/MarkdownTextField.kt | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/ui/MarkdownTextField.kt b/app/src/main/java/com/wbrawner/simplemarkdown/ui/MarkdownTextField.kt index 24defff..bb36db2 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/ui/MarkdownTextField.kt +++ b/app/src/main/java/com/wbrawner/simplemarkdown/ui/MarkdownTextField.kt @@ -63,16 +63,21 @@ fun MarkdownTextField( focusedIndicatorColor = Color.Transparent, unfocusedIndicatorColor = Color.Transparent ) - val interactionSource = remember { MutableInteractionSource() } - val textStyle = TextStyle.Default.copy( - fontFamily = FontFamily.Monospace, - color = MaterialTheme.colorScheme.onSurface - ) + val interactionSource = remember { MutableInteractionSource() } + val textStyle = TextStyle.Default.copy( + fontFamily = FontFamily.Monospace, + color = MaterialTheme.colorScheme.onSurface + ) + Column( + modifier = modifier + .fillMaxSize() + .imePadding() + .verticalScroll(rememberScrollState()) + ) { CompositionLocalProvider(LocalTextSelectionColors provides colors.textSelectionColors) { BasicTextField( value = textFieldValue, - modifier = modifier.fillMaxSize() - .imePadding(), + modifier = Modifier.fillMaxSize(), onValueChange = setTextFieldAndViewModelValues, enabled = true, readOnly = false, @@ -102,6 +107,7 @@ fun MarkdownTextField( } ) } + } } private fun String.annotate(enableReadability: Boolean): AnnotatedString {