I have this bottom sheet where the layout is like ...
# compose
b
I have this bottom sheet where the layout is like this:
Copy code
Column {
 BasicTextField() {...}
 Button(...)
}
The keyboard overlaps the bottom sheet for Android 10 and below. But works fine for 11+ (hides the button though) So, what I did was, added window insets like: if (Current Android version < Android 11) WindowInset.ime else WindowInsets(0,0,0,0) Is there any other fix you guys know? The UI literally sucks and it's not how it should be. It normally adds so much blank space in between sheet and keyboard
n
Did you use
imePadding
? 👀
b
Yes I did. Same results. Didn't worked for Android 10 and lower
n
Is this what you expected?
b
Yes, I want the entire sheet to move on top of the keyboard regardless the Android version
But there's always a catchy. Either it doesn't, or it adds a space in between (white if WindowInset.ime and Transport if .imePadding())
n
well, Here's my approximate code:
Copy code
Column {
  BasicTextField()
  ToolBar(Modifier.imePadding().navigationBarsPadding())
}
the above code has no problem for me, it works on Android 7 and above BTW, Did you set
android:windowSoftInputMode="adjustResize"
in Manifest.xml?
b
Yes for the manifest its there, sorry forgot to mention.
What's the toolbar here? Assuming it's the layout replacement for buttons you used?
n
image.png
b
I'll share the code and design if that helps. Apologise, gotta go.
So what I did was, I added a check if Ime is visible, I'll add 0 padding in the bottom, else I'll add bottom navigation bar height as bottom padding. This fixed the issue for Android 10 and lower. And although the buttons are not visible for Android 11 and above, but gets the work done. imePadding() does no good in this case, gonna drop it
z
Are you also using enableEdgeToEdge or manually calling setDecorFitsSystemWindows?
If so, please file a bug
👀 1
Also I think you’d want to apply the imePadding to the entire column, otherwise the text field could be laid out behind the keyboard if there’s enough lines
b
Yes, I'm using edgeToEdge
For imePadding() I'm not sure. It just adds an extra space in Android 11 and above. And doesn't behaves properly for Android 10 and lower
I'll confirm anyway.