Fixed
Status Update
Comments
ma...@google.com <ma...@google.com>
an...@google.com <an...@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.
ed...@gmail.com <ed...@gmail.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.
an...@google.com <an...@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.
an...@google.com <an...@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)
}
}
}
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit a3b566102eb60c3396dfae0dd5ea57e8eb15f0a1
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Thu May 20 20:57:53 2021
Fix for LazyColumn/Row items displayed partially after the scroll
It was the old issue with how we handle not placed children which became often reproducible after introducing slots reuse in LazyColumn. When the layout was not placing its children node remeasuring and redrawing for such node and its children was skipped as this node is not visible. Once this node was becoming visible again we weren't correctly restoring the node's sub-hierarchy. Now we correctly reschedule remeasurings and redrawings for the dirty nodes for the whole subtree.
Relnote: Fixed the bug introduced in beta07 where LazyColumn/Row items were displayed partially after the scroll
Test: InvalidatingNotPlacedChildTest
Bug: 188566058
Change-Id: I8c9ac2df59f3183bf6067dd20092a127f16c9e80
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/InvalidatingNotPlacedChildTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNodeWrapper.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutTreeConsistencyChecker.kt
https://android-review.googlesource.com/1713858
Branch: androidx-main
commit a3b566102eb60c3396dfae0dd5ea57e8eb15f0a1
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Thu May 20 20:57:53 2021
Fix for LazyColumn/Row items displayed partially after the scroll
It was the old issue with how we handle not placed children which became often reproducible after introducing slots reuse in LazyColumn. When the layout was not placing its children node remeasuring and redrawing for such node and its children was skipped as this node is not visible. Once this node was becoming visible again we weren't correctly restoring the node's sub-hierarchy. Now we correctly reschedule remeasurings and redrawings for the dirty nodes for the whole subtree.
Relnote: Fixed the bug introduced in beta07 where LazyColumn/Row items were displayed partially after the scroll
Test: InvalidatingNotPlacedChildTest
Bug: 188566058
Change-Id: I8c9ac2df59f3183bf6067dd20092a127f16c9e80
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/InvalidatingNotPlacedChildTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNodeWrapper.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutTreeConsistencyChecker.kt
an...@google.com <an...@google.com> #7
The issue was fixed and is planned to be released in beta08.
In case you want to try it earlier you can try the snapshot build. buildId is 7393783. See this site with instructions:https://androidx.dev .
Thanks everyone!
In case you want to try it earlier you can try the snapshot build. buildId is 7393783. See this site with instructions:
Thanks everyone!
pz...@gmail.com <pz...@gmail.com> #8
Is there an expected release date for beta08?
za...@gmail.com <za...@gmail.com> #9
Compose generally releases every two weeks on Wednesday. That puts the next release on Jun 2.
Description
Jetpack Compose release version: 1.0.0-beta07
Android Studio Build: Android Studio Arctic Fox | 2020.3.1 Canary 14
We have a set of non trivial list items which when scrolled past and then scrolled back to end up disappearing (see attached video). Issue only started happening when app was upgraded to compose beta07.
Additional info
Items are fed in with
items(state.model.sessions.byDay[date].orEmpty().size)
Items expand when pressed and make use of animated visibility / animated size composables
I'm more than happy to share more code / try build a minimal recreation. If possible it would be good to get more direction on what areas could possibly cause this to help with the recreation as my current screen is non trivial. I tried just a basic lazy list with some text and that all worked as expected.
Thanks a tonne for all your work on this one!