Status Update
Comments
nj...@google.com <nj...@google.com>
an...@google.com <an...@google.com> #2
For your use case did you try to provide contentPadding param with the size of your status bar/toolbar? The items will still be drawn in the padded area, but this will also adjust the start position of the first item so when you do scrollToItem() it will be positioned after the specified padding
Description
Jetpack Compose release version: 1.1.0-alpha04
Let's say we have a translucent status bar/toolbar and default LazyColumn with a lot of items, which draws underneath toolbar. When we want to scroll to some item, we only have a
scrollToItem()
/animateScrollToItem()
which accepts index and only positive scroll offset. But if we scroll to some item using it's index, it will appear beneath the status bar and wont be visible, so we need to either additionallyanimateScrollBy(-someOffset)
, which does not look particularly fluent, oranimateScrollTo(desiredIndex - someConstant)