I'm a little confused on how the Modifier.imePaddi...
# compose
t
I'm a little confused on how the Modifier.imePadding() is supposed to work. What I've discovered through poking around with it, is that if I add that modifier to any node at the TextField or above in the hierarhcy of the compose tree, when my TextField takes focus and the keyboard pops up, the entire app will slide upwards so that the TextField baseline is at the top of the keyboard and then return when the keyboard is dismissed. In my case, I'm using a BasicTextField and have some decoration around it, but it ends up clipping out the decoration and containing row/card, which is kind of ugly. The effect I want, is to scroll the containing list upwards if necessary until the entire card/row that contains my text field is exposed, and then to scroll back the same amount when the keyboard is complete/closed. Is that possible at all? I'm guessing I'll need to do more of that work myself... but I'm a little unclear where to even start throwing darts.
a
Are you using
android:windowSoftInputMode="adjustResize"
for your Activity?
t
I did not. But some of the SO posts said you didn't need to do that anymore? Or maybe I misunderstand. I added that... and now it's behaving differently, haven't had a chance to explore what's changed. My list header doesn't move anymore.
With that added, it seems to still not matter where I put it in the tree, but it seems to be able to detect that there's a scrollable thing in the tree of the text field, and only scroll the scrollbable container. however, the behavior that it only scrolls to the baseline of the text field, rather than letting me control how much to expose, remains. Also, in this mode, when I dismiss the keyboard, it doesn't scroll back to where it was
324 Views