Skip to content

Commit

Permalink
Fix notes textfeild going below the keyboard as the user types
Browse files Browse the repository at this point in the history
Signed-off-by: starry-shivam <[email protected]>
  • Loading branch information
starry-shivam committed Jul 21, 2023
1 parent cd0c0fc commit 5d52dab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.GreenStash.Splash"
android:windowSoftInputMode="adjustPan">
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
Expand Down Expand Up @@ -228,7 +231,11 @@ fun InputScreen(editGoalId: String?, navController: NavController) {
})
}

Scaffold(modifier = Modifier.fillMaxSize(),
Scaffold(modifier = Modifier
.fillMaxSize()
.statusBarsPadding()
.navigationBarsPadding()
.imePadding(),
snackbarHost = { SnackbarHost(snackBarHostState) },
topBar = {
TopAppBar(modifier = Modifier.fillMaxWidth(), title = {
Expand Down Expand Up @@ -289,7 +296,7 @@ fun InputScreen(editGoalId: String?, navController: NavController) {
.fillMaxSize()
.background(MaterialTheme.colorScheme.background)
.padding(it)
.verticalScroll(rememberScrollState()),
.verticalScroll(rememberScrollState(), reverseScrolling = true),
) {
Spacer(modifier = Modifier.height(12.dp))
Box(
Expand Down

0 comments on commit 5d52dab

Please sign in to comment.