So i'm trying to implement a search bar using a cu...
# compose
m
So i'm trying to implement a search bar using a custom wrapper for BottomSheetScaffold along with my own custom search bar state (similar to SnackbarData and SnackbarHostState). I've got it all working, but the keyboard is covering up my confirm button. Is there a way at the composable level to tell the composable to resize when the keyboard is shown? I really don't want to have to do this at the activity level, as we don't necessarily always want that behavior.
for reference the sheet contains a column with the close button, text field, lazy list (with a weight of 1) and the button. The code is pretty long, but i can try and paste it here if needed.
o
Did you try an
.imePadding
modifier? You could try to add it to your Column.
m
@Oleksandr Balan That only works if you do this:
Copy code
WindowCompat.setDecorFitsSystemWindows((LocalView.current.context as Activity).window, false)
But that has other side effects that require you to make sure you use the .statusBarPadding() modifier and other things. I'm trying to make something that's entirely standalone and self contained. The above works, but as i've said it requires the user of the container to do that and make sure they use statusBarPadding as well:
Copy code
SearchBarScaffold(
                modifier = Modifier.statusBarsPadding(),
                searchBarHostState = searchBarHostState
            ) {
                Column(modifier = Modifier.padding(it).padding(16.dp)) {
I'd love to find a standalone solution that just works no matter whether the flag is set or not.
The other issue i'm having is that when i am at the top of the LazyColumn and try to swipe down, it's still pulling down the bottom sheet and attempting to close it despite having disabled the gestures on it.