Mark
02/28/2026, 3:43 AMsafeDrawing.bottom: 984
... <repeated values> ...
safeDrawing.bottom: 984
safeDrawing.bottom: 1005
as expected, keyboard is hidden. However, bottom padding remains.
2. tap on text field to open soft keyboard
safeDrawing.bottom: 102
... <smooth progression> ...
safeDrawing.bottom: 1005
3. close soft keyboard
safeDrawing.bottom: 990
... <smooth progression> ...
safeDrawing.bottom: 102
now correct padding shows.wwalkingg
02/28/2026, 5:59 AMMark
02/28/2026, 6:00 AMMark
02/28/2026, 6:02 AMMark
02/28/2026, 6:06 AMwwalkingg
02/28/2026, 6:09 AMMark
02/28/2026, 6:10 AMwwalkingg
02/28/2026, 6:10 AMwwalkingg
02/28/2026, 6:11 AMMark
02/28/2026, 6:12 AMwwalkingg
02/28/2026, 6:15 AMwwalkingg
02/28/2026, 6:16 AMMark
02/28/2026, 6:16 AMwwalkingg
02/28/2026, 6:16 AMMaterialTheme {
val softwareKeyboardController = LocalSoftwareKeyboardController.current
var showContent by remember { mutableStateOf(false) }
Column(
modifier = Modifier
.fillMaxSize()
.safeDrawingPadding()
.background(MaterialTheme.colorScheme.primaryContainer)
.border(1.dp, Color.Black),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Bottom
) {
TextField(
value = "${WindowInsets.ime.getBottom(LocalDensity.current)}",
onValueChange = {}
)
Button(
onClick = { softwareKeyboardController?.hide() }
) { Text("Close") }
}
}Mark
02/28/2026, 7:25 AMmovableContentOf to preserve the TextField state:
val textField = remember {
movableContentOf {
TextField(
value = "${WindowInsets.ime.getBottom(LocalDensity.current)}",
onValueChange = {}
)
}
}
Column(
modifier = Modifier
.fillMaxSize()
.safeDrawingPadding()
.background(MaterialTheme.colorScheme.primaryContainer)
.border(1.dp, Color.Black),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Bottom
) {
if (isLandscape()) {
textField()
} else {
// normally would have a different layout, but even with the same composable, the issue occurs
textField()
}
}
@Composable
fun isLandscape(): Boolean {
val containerSize = LocalWindowInfo.current.containerSize
return containerSize.width > containerSize.height
}
This also demonstrates a related UI glitch issue (see end of video) where the screen goes into a never-ending spasm.Mark
02/28/2026, 7:28 AMwwalkingg
03/01/2026, 7:36 AMMark
03/01/2026, 7:36 AMwwalkingg
03/02/2026, 1:05 AMMark
03/03/2026, 10:09 AMAndrei Salavei
03/03/2026, 10:30 AM