Skip to content

Commit 650fe7f

Browse files
committed
Apply imePadding and set windowSoftInputMode
This commit ensures the UI correctly adjusts for the on-screen keyboard by: - Adding `imePadding()` to the `Scaffold` modifier in `DiffCheckerScreen.kt`. - Setting `android:windowSoftInputMode="adjustResize"` for `MainActivity` in `AndroidManifest.xml`.
1 parent e8c702e commit 650fe7f

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
<activity
1616
android:name=".presentation.MainActivity"
1717
android:exported="true"
18-
android:theme="@style/Theme.DiffChecker">
18+
android:theme="@style/Theme.DiffChecker"
19+
android:windowSoftInputMode="adjustResize">
1920
<intent-filter>
2021
<action android:name="android.intent.action.MAIN" />
2122

app/src/main/java/dev/jahidhasanco/diffly/presentation/screen/DiffCheckerScreen.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import androidx.compose.foundation.layout.Spacer
1010
import androidx.compose.foundation.layout.fillMaxSize
1111
import androidx.compose.foundation.layout.fillMaxWidth
1212
import androidx.compose.foundation.layout.height
13+
import androidx.compose.foundation.layout.imePadding
1314
import androidx.compose.foundation.layout.padding
1415
import androidx.compose.foundation.layout.size
1516
import androidx.compose.foundation.layout.wrapContentWidth
@@ -65,7 +66,7 @@ fun DiffCheckerScreen(viewModel: MainViewModel) {
6566
var expanded by remember { mutableStateOf(false) }
6667
var selectedViewType by remember { mutableStateOf(DiffViewType.TWO_SIDE) }
6768
Scaffold(
68-
modifier = Modifier.fillMaxSize(),
69+
modifier = Modifier.fillMaxSize().imePadding(),
6970
containerColor = background,
7071
topBar = {
7172
TopAppBar(

0 commit comments

Comments
 (0)