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
This commit is contained in:
William Brawner 2024-01-29 21:12:08 -07:00
parent f891d3635d
commit a35aa62399

View file

@ -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,