Status Update
Comments
le...@gmail.com <le...@gmail.com> #2
Project: platform/frameworks/support
Branch: androidx-main
Author: Louis Pullen-Freilich <
Link:
Adds OverscrollEffect#withoutDrawing and OverscrollEffect#withoutEventHandling
Expand for full commit details
Adds OverscrollEffect#withoutDrawing and OverscrollEffect#withoutEventHandling
These APIs allow overscroll to have events dispatched to it by one component, and rendered in a separate component.
Fixes: b/266550551
Fixes: b/204650733
Fixes: b/255554340
Fixes: b/229537244
Test: OverscrollTest
Relnote: "Adds OverscrollEffect#withoutDrawing and OverscrollEffect#withoutEventHandling APIs - these APIs create a wrapped instance of the provided overscroll effect that doesn't draw / handle events respectively, which allows for rendering overscroll in a separate component from the component that is dispatching events. For example, disabling drawing the overscroll inside a lazy list, and then drawing the overscroll separately on top / elsewhere."
Change-Id: Idbb3d91546b49c1987a041f959bce4b2b09a9f61
Files:
- M
compose/foundation/foundation/api/current.txt
- M
compose/foundation/foundation/api/restricted_current.txt
- M
compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/OverscrollDemo.kt
- M
compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/OverscrollSample.kt
- M
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/OverscrollTest.kt
- M
compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Overscroll.kt
Hash: f64e25b7a473c757d080521e7dd97b3f6670f60d
Date: Fri Nov 01 18:43:56 2024
nj...@google.com <nj...@google.com>
lp...@google.com <lp...@google.com>
so...@google.com <so...@google.com> #3
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.8.0-alpha06
androidx.compose.foundation:foundation-android:1.8.0-alpha06
androidx.compose.foundation:foundation-jvmstubs:1.8.0-alpha06
androidx.compose.foundation:foundation-linuxx64stubs:1.8.0-alpha06
le...@gmail.com <le...@gmail.com> #4
Yes, this should be issue with any composable that is sibling to vertical divider inside intrinsic-min parent. Sorry for not being clear in report.
po...@google.com <po...@google.com>
an...@google.com <an...@google.com> #5
ma...@hopper.com <ma...@hopper.com> #6
Any updates on this?
I'm pretty sure this is the bug behind this StackOverflow question too:
The intrinsic size calculation is wrong for some reasons (probably not passing in the proper constraints when calculating the intrinsic size of the children).
A simpler demo of the issue is:
@Preview(showBackground = true, widthDp = 300, heightDp = 400)
@Composable
fun TestRowCompose() {
LazyColumn() {
item {
Row(
modifier = Modifier
.height(intrinsicSize = IntrinsicSize.Min)
.background(Color.Magenta),
verticalAlignment = Alignment.Top,
) {
Text(text = "abcde", Modifier.fillMaxWidth(0.25f).background(Color.Red))
}
}
}
}
I'm expecting the Magenta background to be the height of the Red backgorund, but instead it is bigger.
It's actually as high as the text if each characters were rendered on their own line, which seems to indicate an improper constraints in width when measuring the minIntrinsicHeight
for the Text
.
Adding characters to the text grows the vertical height of the Purple background, which is unexpected.
sz...@gmail.com <sz...@gmail.com> #7
Any updates on this?
uo...@google.com <uo...@google.com> #9
This is actually a text bug. It has to do with the cache stopping the update from happening:
I tested out the sample
Reassigning to Sean to take a look
se...@google.com <se...@google.com> #10
Thanks for digging into this!
se...@google.com <se...@google.com> #11
I suspect there may be two bugs stacked on top of each other based on history.
I'll fix the text over-caching issue quick and then we can see if the remaining intrinsics bug lingers.
Thanks!
Sean
se...@google.com <se...@google.com> #12
Update: It looks like this was just a text issue I can't reproduce without text.
Fixing in aosp/2962173
ap...@google.com <ap...@google.com> #13
Branch: androidx-main
commit e9ef4f948b25c55dd15eecf31476b287fd3966d8
Author: Sean McQuillan <seanmcq@google.com>
Date: Tue Feb 13 16:58:34 2024
Don't cache intrinsicHeight through text changes
Only applies to annotatedstring / layout result implementation
Fixes:
Test: ./gradlew :com:found:found:cAT
Change-Id: Ied047b99122e43d1a0c088f742fe090df5c0c4c2
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/modifiers/MultiParagraphLayoutCacheTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/MultiParagraphLayoutCache.kt
mt...@gmail.com <mt...@gmail.com> #14
Any hope this fix will make it into a 1.6.x release?
se...@google.com <se...@google.com> #15
Trying to get it into 1.6.2
se...@google.com <se...@google.com> #16
Yep, it's heading in to 1.6.2.
Thanks for asking! Was able to make the cut :)
se...@google.com <se...@google.com> #17
Since hotpatching and linking to this bug - adding notes.
This bug applied if any of the following conditions were met:
- Text was selectable (selection container is not null)
- Text is annotated string
- onTextLayoutResult callback is not null
The "simple text" path (which exists for optimization reasons) did not have this bug. Notably TextStringSimpleNode / Paragraph cache was already
To force the issue if it is appearing randomly in your app, the easiest way would be to ensure you always pass an AnnotatedString for all Text/BasicText that you're debugging.
pr...@google.com <pr...@google.com> #18
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.6.2
androidx.compose.foundation:foundation-android:1.6.2
androidx.compose.foundation:foundation-desktop:1.6.2
androidx.compose.foundation:foundation:1.7.0-alpha03
androidx.compose.foundation:foundation-android:1.7.0-alpha03
androidx.compose.foundation:foundation-desktop:1.7.0-alpha03
mt...@gmail.com <mt...@gmail.com> #19
Thanks for including it into 1.6.2, which allows me to fix an annoying display bug!
Description
Description has been deleted.