Hey guys, trying to figure out how to do something...
# compose-android
b
Hey guys, trying to figure out how to do something. I'm trying to get it so that the bottomBar is not visible when opening the soft keyboard. I've accomplished this sort of by only including imePadding() on the content of my scaffold and not on the whole scaffold, so that way the imePadding isn't applied to the bottomBar, however in the content of my scaffold I'm passing the innerPadding values from the Scaffold to my Column, so when the keyboard is open the padding for the bottomBar is still applied. I have two questions though, should I be hiding the bottomBar in this way, or would it be better to just do a check in bottomBar composable to check if the ime is visible and if not don't compose the bottomBar at all and if the original way I'm trying to target this is fine, how do I stop the padding from the bottomBar from being included on my Column? Do I just need to check if ime is visible and then choose not to apply the scaffolds innerPadding? I was under the impression I shouldn't do this since the warning about not using innerPadding from a Scaffold. See thread for video
Big Bottom Bar Padding.webm
a
I’d recommend calling
Modifier.consumedWindowInsets
with your `Scaffold`’s
innerPadding
before you add the
imePadding
inside the
Scaffold
. That’ll reduce how much padding
imePadding
applies by precisely the amount of padding already applied by using the `Scaffold`’s
innerPadding
, so that you don’t get that amount double applied like you’re currently seeing.
👍 2