Status Update
Comments
an...@tomorrow.one <an...@tomorrow.one> #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
le...@google.com <le...@google.com>
le...@google.com <le...@google.com>
le...@google.com <le...@google.com>
va...@gmail.com <va...@gmail.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
fe...@gmail.com <fe...@gmail.com> #4
Same for compose compiler 1.5.11
Fatal Exception: java.lang.IllegalArgumentException maxWidth(-90) must be >= than minWidth(0)
at androidx.compose.ui.unit.ConstraintsKt.Constraints(Constraints.kt:424)
at androidx.compose.ui.unit.ConstraintsKt.Constraints$default(Constraints.kt:418)
jo...@google.com <jo...@google.com>
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit 51900c870dcafca33f1dfddf9ecd4e711d36e914
Author: Jossi Wolf <jossiwolf@google.com>
Date: Tue May 07 17:39:14 2024
Coerce Pager's page size to min 0
In some cases, we could previously end up with a negative size returned from PageSize. There were two scenarios:
- Custom PageSize implementation returning a negative value
- PageSize.Fill (the default size) returning the incoming value, which could be negative if the content padding is bigger than the constraints' main axis space
Relnote: Fixed a bug where Pager would crash when the contentPadding was bigger than the incoming constraints. Pager now coerces negative values returned from PageSize to 0.
Test: contentPadding_largerThanConstraints_measuresAsZero, pageSize_smallerThanAvailableSpace_measuresAsZero
Bug: 314008560
Change-Id: Iba5d8eccddaf1a49bb09dc4f93d8a4f38276d60b
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/pager/PagerTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/pager/PagerMeasurePolicy.kt
jo...@google.com <jo...@google.com>
ra...@inmobi.com <ra...@inmobi.com> #6
jo...@google.com <jo...@google.com> #7
This fix is included in tip of tree, you can try it out by using a snapshot build (androidx.dev). We have an automated integration that will add a comment once this change has been included in a release.
pr...@google.com <pr...@google.com> #8
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.7.0-beta01
androidx.compose.foundation:foundation-android:1.7.0-beta01
androidx.compose.foundation:foundation-desktop:1.7.0-beta01
wi...@kakaomobility.com <wi...@kakaomobility.com> #9
I'm using compose 1.6.3 and I got crash when update content padding to lager value. ex) Portrait -> Landscape.
To workaround this problem, I updated pager before adjusting the content padding. It seems worthless, but worked well.
val contentPadding = remember { mutableStateOf(10000.dp) }
val newContentPadding = calcPadding()
val scope = rememberCoroutineScope()
if (newContentPadding <= contentPadding.value) { // smaller padding : no problem
contentPadding.value = newContentPadding
} else { // larger padding : crash!
scope.launch {
pagerState.scrollToPage(pagerState.currentPage) // update pager
contentPadding.value = newContentPadding // then update padding
}
}
ga...@gmail.com <ga...@gmail.com> #10
We're still seeing high volumes of this in 1.7.0
fi...@gmail.com <fi...@gmail.com> #11
I encountered similar exception on Nothing Phone (1) @ API 34 with ComposeView inside CardView. Opens normally, then 100% reproducible when switching day/night mode, probably other layout recreations will do. Didn't crash tho on neither of AVD Pixel API 35, redmi 10 API 31, samsung a70 api 30.
For me WORKAROUND was to add android:layout_marginTop="0dp"
to ComposeView, I hope it'll help someone.
My xml: ConstraintLayout(root) > LinearLayout(wrap_content) > CardView(wrap_content) > ComposeView(wrap_content)
Sorry if that does not make sense lol, but works as expected with various non-compose children. I thought it might be relevant since ConstraintLayout is also present.
kotlin = "2.0.21"
appcompat = "1.7.0"
activityCompose = "1.9.3"
composeBom = "2024.10.00"
java.lang.IllegalArgumentException: maxWidth(-252) must be >= than minWidth(0)
at androidx.compose.ui.unit.InlineClassHelperKt.throwIllegalArgumentException(InlineClassHelper.kt:30)
at androidx.compose.ui.unit.ConstraintsKt.Constraints(Constraints.kt:721)
at androidx.compose.ui.unit.ConstraintsKt.Constraints$default(Constraints.kt:543)
at androidx.compose.ui.node.NodeMeasuringIntrinsics.minHeight$ui_release(LayoutModifierNode.kt:297)
at androidx.compose.ui.node.LayoutModifierNode.minIntrinsicHeight(LayoutModifierNode.kt:95)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.minIntrinsicHeight(LayoutModifierNodeCoordinator.kt:220)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.minIntrinsicHeight(LayoutNodeLayoutDelegate.kt:912)
at androidx.compose.material3.ListItemMeasurePolicy.measure-3p2s80s(ListItem.kt:234)
at androidx.compose.ui.layout.MultiContentMeasurePolicyImpl.measure-3p2s80s(MultiContentMeasurePolicy.kt:209)
at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.kt:135)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:316)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:315)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:503)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:502)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:258)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(OwnerSnapshotObserver.kt:113)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate.performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:1782)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:40)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:696)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.measure-BRTryo0(LayoutNodeLayoutDelegate.kt:672)
at androidx.compose.foundation.layout.BoxMeasurePolicy.measure-3p2s80s(Box.kt:151)
at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.kt:135)
at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.measure-3p2s80s(GraphicsLayerModifier.kt:646)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:188)
at androidx.compose.animation.SizeAnimationModifierNode.measure-3p2s80s(AnimationModifier.kt:195)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:188)
at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.measure-3p2s80s(GraphicsLayerModifier.kt:646)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:188)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:316)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:315)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:503)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:502)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:258)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(OwnerSnapshotObserver.kt:113)
jo...@google.com <jo...@google.com> #12
Hi, can you please share a reproduction case with us?
fi...@gmail.com <fi...@gmail.com> #13
I realized later it stopped reproducing after minor changes in code not even close to UI, which I had to add to try other devices (the Card contained play integrity error specific to Nothing). This was midcommit, I tried to recover setup, but failed.
Idk, maybe it was related more to build cache issues, rather than view/compose interop.
If I catch it again, I come back
jo...@google.com <jo...@google.com> #14
#13, thanks!
#10, please let us know if you have a repro case for us!
Description
Affected compose versions:
Suspected Jetpack Compose components:
Kotlin version: 1.9.20
The crash is not reproducible and we can’t figure out the app code origin
Stack trace (if applicable):