If I’ve got a LazyColumn, and I am scrolled all th...
# compose
s
If I’ve got a LazyColumn, and I am scrolled all the way to the bottom, and the IME opens, is it possible to make it so that the LazyColumn instead of keeping the scroll position as is (the bottom item gets hidden behind the IME) it moves that bottom item in view too? So it feels like that bottom item is moving together with the IME. I am using the foundation compose inset APIs and using WindowInsets.safeDrawing I have succeeded in making it so that I can then scroll myself and have the bottom item show propely (the correct amount of padding is added to the bottom of that LazyList) but I am not sure if I a can also at the same time achieve what I am describing above.
Although as I’m thinking about it, maybe that’d then look weird if I was scrolled all the way to the top. So maybe I simply don’t want to do that 🤔 I wonder if there are any material design guidelines regarding how such an interaction should work.
z
I know its deprecated, but it has some good info! It eventually points to this, I havent played with it, but maybe it can help you 🙏🏽
s
Huh, that’s kinda like magic, one modifier
androidx.compose.foundation.layout.imeNestedScroll()
and I now get this recording: Not exactly what I was looking for, but I think I’m now realizing what I was going for is most likely not what I want, since as I said above in all other cases aside from already being scrolled down to the bottom of the list this behavior would be odd. Also see how this makes it so that you need to do 2 swipes down to reach the end of the list? And as the IME is coming up then you get the overscrolling effect which stretches the items while I’m still not at the end of the list, since part of it is still hidden behind the IME. And then when I do another swipe then I do get the rest of the list. I think I’ll have to let this be and not use this modifier yet 🤷‍♂️ Thanks for bringing my attention to this though, I didn’t know we could do something like this 😄 I wonder if it’s still experimental due to (maybe among other things) this weird interaction, or if this is expected behavior 🤔
z
I was also surprised to learn that its just one modifier! Your recording kind of made me think about this, Doris Liu posted a great response there that explains it. Not exactly sure thats what youre seeing the effect of, but thats all Ive got 😄
s
Yeap thanks a lot for the help and the ideas! I think I’ll just hold off with the imeNestedScroll and leave it be as it is👌
z
Known issue, there are bugs I don't have on hand on my phone at the moment. We're working on it
s
That’s awesome to hear, I mean it makes sense since it’s experimental. Looking forward to use it when it’s ready though, it’s crazy that this is just a single modifier 🤯