Fixed
Status Update
Comments
kl...@google.com <kl...@google.com>
kl...@google.com <kl...@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)
}
}
}
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
Description
This is how
ScrollView
works.Modifier.focusable
does already callBringIntoViewRequester.bringIntoView()
, but that doesn't work if the focusable is already in view request is made, but a scrollable parent resizes afterwards (as in the case when the keyboard is shown after a small delay).See design doc .