From a35aa623999faf200f96a2353e0529870aa176b4 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Mon, 29 Jan 2024 21:12:08 -0700 Subject: [PATCH] Add extra padding to text field when keyboard is open This allows users to be able to scroll all the way to the bottom of long documents without the keyboard obscuring the text --- .../main/java/com/wbrawner/simplemarkdown/ui/MainScreen.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/ui/MainScreen.kt b/app/src/main/java/com/wbrawner/simplemarkdown/ui/MainScreen.kt index 1a26890..bcb3e2f 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/ui/MainScreen.kt +++ b/app/src/main/java/com/wbrawner/simplemarkdown/ui/MainScreen.kt @@ -10,6 +10,7 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.RowScope import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.imePadding import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.pager.HorizontalPager @@ -254,7 +255,8 @@ fun MainScreen( if (page == 0) { TextField( modifier = Modifier - .fillMaxSize(), + .fillMaxSize() + .imePadding(), colors = TextFieldDefaults.colors( focusedContainerColor = MaterialTheme.colorScheme.surface, unfocusedContainerColor = MaterialTheme.colorScheme.surface,