Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
I was able to reproduce the issue. It is broken since https://android-review.googlesource.com/c/platform/frameworks/support/+/1686519 .
I don't think there is any workaround available so I recommend for everyone affected to stay on beta06 for a bit.
I don't think there is any workaround available so I recommend for everyone affected to stay on beta06 for a bit.
ap...@google.com <ap...@google.com> #3
Take this with a huge grain of salt but I had the same/similar issue occasionally on beta06
and before as well. It got a lot worse with beta07
. Just scrolling and randomly finding items that are not rendered whatsoever. I'm developing deeply nested dynamic forms so I could be hitting multiple edge cases or perhaps made a mistake myself but I don't have these issues with a verticalScroll
modifier on a regular column.
ap...@google.com <ap...@google.com> #4
I localised the issue and indeed looks like similar situation could be reproduced even before beta07, just not so often. Especially it was possible if you emit multiple layouts per item of LazyColumn. I am working on the fix.
ap...@google.com <ap...@google.com> #5
Found a temporary workaround
Instead of your current:
LazyColumn {
items(myList) {
MyItem(it)
}
}
Do
LazyColumn {
itemsIndexed(myList) { index, it ->
key(index) { // TODO remove key() after upgrade to beta08
MyItem(it)
}
}
}
Description
Why to do so:
1) To allow custom layouts to insert the layers for the children if they need to. For example It is needed in LazyColumn as an optimization (
2) Allows to simplify the system by having less concepts. Now DrawLayerModifier is a whole separate concept. With integrating layers right inside the layout system Modifier.drawLayer() will be implemented just as a simple LayoutModifier with DrawLayerModifier class being removed. We already did the same thing with ZIndexModifier (