Status Update
Comments
ha...@google.com <ha...@google.com>
ma...@google.com <ma...@google.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
vy...@gmail.com <vy...@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
xo...@affirm.com <xo...@affirm.com> #4
vy...@gmail.com <vy...@gmail.com> #5
b....@fetchrewards.com <b....@fetchrewards.com> #6
vy...@gmail.com <vy...@gmail.com> #7
ch...@gmail.com <ch...@gmail.com> #8
compose-bom = "2023.10.01"
Exception java.lang.IllegalArgumentException: Cannot round NaN value.
at kotlin.math.MathKt__MathJVMKt.roundToInt (MathJVM.kt:1165)
at androidx.compose.material3.AppBarKt$TopAppBarLayout$2.measure-3p2s80s (AppBar.kt:1361)
at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0 (InnerNodeCoordinator.kt:126)
at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.measure-3p2s80s (GraphicsLayerModifier.kt:646)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0 (LayoutModifierNodeCoordinator.kt:116)
at androidx.compose.foundation.layout.InsetsPaddingModifier.measure-3p2s80s (WindowInsetsPadding.kt:171)
at androidx.compose.ui.node.BackwardsCompatNode.measure-3p2s80s (BackwardsCompatNode.kt:311)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0 (LayoutModifierNodeCoordinator.kt:116)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasure$2.invoke (LayoutNodeLayoutDelegate.kt:1499)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasure$2.invoke (LayoutNodeLayoutDelegate.kt:1495)
at androidx.compose.runtime.snapshots.Snapshot.enter (Snapshot.java:131)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe (Snapshot.kt:476)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe (SnapshotStateObserver.kt:467)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads (SnapshotStateObserver.kt:230)
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.java:1495)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0 (LayoutNodeLayoutDelegate.java:35)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0 (LayoutNodeLayoutDelegate.kt:560)
at androidx.compose.ui.node.LayoutNode.remeasure-_Sx5XlM$ui_release (LayoutNode.kt:1140)
at androidx.compose.ui.node.LayoutNode.remeasure-_Sx5XlM$ui_release$default (LayoutNode.kt:1131)
at androidx.compose.ui.node.MeasureAndLayoutDelegate.doRemeasure-sdFAvZA (MeasureAndLayoutDelegate.kt:323)
at androidx.compose.ui.node.MeasureAndLayoutDelegate.remeasureAndRelayoutIfNeeded (MeasureAndLayoutDelegate.kt:458)
at androidx.compose.ui.node.MeasureAndLayoutDelegate.access$getRoot$p (MeasureAndLayoutDelegate.kt:39)
at androidx.compose.ui.node.MeasureAndLayoutDelegate.access$remeasureAndRelayoutIfNeeded (MeasureAndLayoutDelegate.kt:39)
at androidx.compose.ui.node.MeasureAndLayoutDelegate.measureAndLayout (MeasureAndLayoutDelegate.kt:344)
at androidx.compose.ui.platform.AndroidComposeView.measureAndLayout (AndroidComposeView.android.kt:879)
at androidx.compose.ui.platform.AndroidComposeView.<init> (AndroidComposeView.android.kt:223)
at androidx.compose.ui.node.Owner.measureAndLayout$default (Owner.java:223)
at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw (AndroidComposeView.android.kt:1127)
at android.view.View.draw (View.java:19317)
at android.view.View.updateDisplayListIfDirty (View.java:18250)
at android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:4252)
at android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:4232)
at android.view.View.updateDisplayListIfDirty (View.java:18209)
at android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:4252)
at android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:4232)
at android.view.View.updateDisplayListIfDirty (View.java:18209)
at android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:4252)
at android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:4232)
at android.view.View.updateDisplayListIfDirty (View.java:18209)
at android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:4252)
at android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:4232)
at android.view.View.updateDisplayListIfDirty (View.java:18209)
at android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:4252)
at android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:4232)
at android.view.View.updateDisplayListIfDirty (View.java:18209)
at android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:4252)
at android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:4232)
at android.view.View.updateDisplayListIfDirty (View.java:18209)
at android.view.ThreadedRenderer.updateViewTreeDisplayList (ThreadedRenderer.java:684)
at android.view.ThreadedRenderer.updateRootDisplayList (ThreadedRenderer.java:690)
at android.view.ThreadedRenderer.draw (ThreadedRenderer.java:804)
at android.view.ViewRootImpl.draw (ViewRootImpl.java:3206)
at android.view.ViewRootImpl.performDraw (ViewRootImpl.java:3004)
at android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:2533)
at android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:1522)
at android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:7292)
at android.view.Choreographer$CallbackRecord.run (Choreographer.java:981)
at android.view.Choreographer.doCallbacks (Choreographer.java:790)
at android.view.Choreographer.doFrame (Choreographer.java:721)
at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:967)
at android.os.Handler.handleCallback (Handler.java:808)
at android.os.Handler.dispatchMessage (Handler.java:101)
at android.os.Looper.loop (Looper.java:166)
at android.app.ActivityThread.main (ActivityThread.java:7529)
at java.lang.reflect.Method.invoke
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:245)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:921)
vy...@gmail.com <vy...@gmail.com> #9
ch...@gmail.com <ch...@gmail.com> #10
vy...@gmail.com <vy...@gmail.com> #11
ap...@google.com <ap...@google.com> #12
Branch: androidx-main
commit f51389603b0fdfe2534dd7249b7b4f027ba08919
Author: Faithful Uchenna Okoye <uokoye@google.com>
Date: Tue Mar 26 21:03:38 2024
Add Debugging logs for hard-to-reproduce bugs
Bug: 300280216
Bug: 297974033
Test: Existing tests passing
Change-Id: Ic49d51a7801dc6b02fe5b8e2fc62dca947028658
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/RowColumnMeasurePolicy.kt
ap...@google.com <ap...@google.com> #13
Branch: androidx-main
commit 881db4641c4c3088c4b559d19831255ed94e1b8a
Author: Faithful Uchenna Okoye <uokoye@google.com>
Date: Fri Mar 29 08:24:08 2024
Modified debugging logs with additional details
Bug: 300280216
Bug: 297974033
Test: Existing tests passing
Change-Id: I0a08f2b7b09bfee064ace2a6efb29c0244b5da22
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/RowColumnMeasurePolicy.kt
ni...@niccoloforlini.com <ni...@niccoloforlini.com> #14
+1 on this as I've seen a spike when bumping to Compose 1.6.x, wild guess here but I think in my case is that due to SwipeToDismiss
L198-L221 in androidx.compose.material:material:1.6.2
:
Box(
Modifier.swipeable(
state = state,
anchors = anchors,
thresholds = thresholds,
orientation = Orientation.Horizontal,
enabled = state.currentValue == Default,
reverseDirection = isRtl,
resistance = ResistanceConfig(
basis = width,
factorAtMin = minFactor,
factorAtMax = maxFactor
)
)
) {
Row(
content = background,
modifier = Modifier.matchParentSize()
)
Row(
content = dismissContent,
modifier = Modifier.offset { IntOffset(state.offset.value.roundToInt(), 0) } // <---- state.offset.value can be NaN?
)
}
Crashes only occur in screens where I have SwipeToDismiss
components, so that's my main guess and only on Android 9 and 10.
na...@google.com <na...@google.com> #15
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation-layout:1.7.0-alpha07
androidx.compose.foundation:foundation-layout-android:1.7.0-alpha07
androidx.compose.foundation:foundation-layout-desktop:1.7.0-alpha07
Description
Android Studio Build: Android Studio Giraffe | 2022.3.1 Patch 1
Kotlin version: 1.9.0
Steps to Reproduce or Code Sample to Reproduce:
- Cannot reproduce it, happens very randomly.
- Screen is scrollable, uses forEach on a list to place elements
Stack trace (if applicable):
```
kotlin.math.MathKt__MathJVMKt in roundToInt at line 1165
androidx.compose.foundation.layout.RowColumnMeasurementHelper in measureWithoutPlacing-_EkL_-Y at line 152
androidx.compose.foundation.layout.RowColumnImplKt$rowColumnMeasurePolicy$1 in measure-3p2s80s at line 71
androidx.compose.ui.node.InnerNodeCoordinator in measure-BRTryo0 at line 126
androidx.compose.foundation.layout.InsetsPaddingModifier in measure-3p2s80s at line 171
androidx.compose.ui.node.BackwardsCompatNode in measure-3p2s80s at line 311
androidx.compose.ui.node.LayoutModifierNodeCoordinator in measure-BRTryo0 at line 116
androidx.compose.foundation.layout.FillNode in measure-3p2s80s at line 698
androidx.compose.ui.node.LayoutModifierNodeCoordinator in measure-BRTryo0 at line 116
androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasure$2 in invoke at line 1499
androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasure$2 in invoke at line 1495
androidx.compose.runtime.snapshots.Snapshot$Companion in observe at line 2299
androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap in observe at line 467
androidx.compose.runtime.snapshots.SnapshotStateObserver in observeReads at line 230
androidx.compose.ui.node.OwnerSnapshotObserver in observeReads$ui_release at line 133
androidx.compose.ui.node.OwnerSnapshotObserver in observeMeasureSnapshotReads$ui_release at line 113
androidx.compose.ui.node.LayoutNodeLayoutDelegate in performMeasure-BRTryo0 at line 1495
androidx.compose.ui.node.LayoutNodeLayoutDelegate in access$performMeasure-BRTryo0 at line 35
androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate in remeasure-BRTryo0 at line 560
androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate in measure-BRTryo0 at line 539
androidx.compose.foundation.layout.BoxKt$boxMeasurePolicy$1 in measure-3p2s80s at line 114
androidx.compose.ui.node.InnerNodeCoordinator in measure-BRTryo0 at line 126
com.swissborg.app.common.compose.navigation.NavigationAnimationsKt$offsetXFactor$1 in invoke-3p2s80s at line 24
com.swissborg.app.common.compose.navigation.NavigationAnimationsKt$offsetXFactor$1 in invoke at line 23
androidx.compose.ui.layout.LayoutModifierImpl in measure-3p2s80s at line 291
androidx.compose.ui.node.LayoutModifierNodeCoordinator in measure-BRTryo0 at line 116
androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasure$2 in invoke at line 1499
androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasure$2 in invoke at line 1495
androidx.compose.runtime.snapshots.Snapshot$Companion in observe at line 2299
androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap in observe at line 467
androidx.compose.runtime.snapshots.SnapshotStateObserver in observeReads at line 230
androidx.compose.ui.node.OwnerSnapshotObserver in observeReads$ui_release at line 133
androidx.compose.ui.node.OwnerSnapshotObserver in observeMeasureSnapshotReads$ui_release at line 113
androidx.compose.ui.node.LayoutNodeLayoutDelegate in performMeasure-BRTryo0 at line 1495
androidx.compose.ui.node.LayoutNodeLayoutDelegate in access$performMeasure-BRTryo0 at line 35
androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate in remeasure-BRTryo0 at line 560
androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate in measure-BRTryo0 at line 539
androidx.compose.foundation.layout.BoxKt$boxMeasurePolicy$1 in measure-3p2s80s at line 136
androidx.compose.ui.node.InnerNodeCoordinator in measure-BRTryo0 at line 126
androidx.compose.foundation.layout.FillNode in measure-3p2s80s at line 698
androidx.compose.ui.node.LayoutModifierNodeCoordinator in measure-BRTryo0 at line 116
androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasure$2 in invoke at line 1499
androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasure$2 in invoke at line 1495
androidx.compose.runtime.snapshots.Snapshot$Companion in observe at line 2299
androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap in observe at line 467
androidx.compose.runtime.snapshots.SnapshotStateObserver in observeReads at line 230
androidx.compose.ui.node.OwnerSnapshotObserver in observeReads$ui_release at line 133
androidx.compose.ui.node.OwnerSnapshotObserver in observeMeasureSnapshotReads$ui_release at line 113
androidx.compose.ui.node.LayoutNodeLayoutDelegate in performMeasure-BRTryo0 at line 1495
androidx.compose.ui.node.LayoutNodeLayoutDelegate in access$performMeasure-BRTryo0 at line 35
androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate in remeasure-BRTryo0 at line 560
androidx.compose.ui.node.LayoutNode in remeasure-_Sx5XlM$ui_release at line 1140
androidx.compose.ui.node.LayoutNode in remeasure-_Sx5XlM$ui_release$default at line 1131
androidx.compose.ui.node.MeasureAndLayoutDelegate in doRemeasure-sdFAvZA at line 323
androidx.compose.ui.node.MeasureAndLayoutDelegate in remeasureOnly at line 503
androidx.compose.ui.node.MeasureAndLayoutDelegate in recurseRemeasure at line 371
androidx.compose.ui.node.MeasureAndLayoutDelegate in recurseRemeasure at line 375
1
androidx.compose.ui.node.MeasureAndLayoutDelegate in measureOnly at line 362
androidx.compose.ui.platform.AndroidComposeView in onMeasure at line 966
android.view.View in measure at line 24549
androidx.compose.ui.platform.AbstractComposeView in internalOnMeasure$ui_release at line 302
androidx.compose.ui.platform.AbstractComposeView in onMeasure at line 289
android.view.View in measure at line 24549
android.view.ViewGroup in measureChildWithMargins at line 6828
android.widget.FrameLayout in onMeasure at line 194
androidx.appcompat.widget.ContentFrameLayout in onMeasure at line 142
android.view.View in measure at line 24549
android.view.ViewGroup in measureChildWithMargins at line 6828
android.widget.LinearLayout in measureChildBeforeLayout at line 1552
android.widget.LinearLayout in measureVertical at line 842
android.widget.LinearLayout in onMeasure at line 721
android.view.View in measure at line 24549
android.view.ViewGroup in measureChildWithMargins at line 6828
android.widget.FrameLayout in onMeasure at line 194
android.view.View in measure at line 24549
android.view.ViewGroup in measureChildWithMargins at line 6828
android.widget.LinearLayout in measureChildBeforeLayout at line 1552
android.widget.LinearLayout in measureVertical at line 842
android.widget.LinearLayout in onMeasure at line 721
android.view.View in measure at line 24549
android.view.ViewGroup in measureChildWithMargins at line 6828
android.widget.FrameLayout in onMeasure at line 194
com.android.internal.policy.DecorView in onMeasure at line 742
android.view.View in measure at line 24549
android.view.ViewRootImpl in performMeasure at line 3007
android.view.ViewRootImpl in measureHierarchy at line 1834
android.view.ViewRootImpl in performTraversals at line 2123
android.view.ViewRootImpl in doTraversal at line 1722
android.view.ViewRootImpl$TraversalRunnable in run at line 7605
android.view.Choreographer$CallbackRecord in run at line 1029
android.view.Choreographer in doCallbacks at line 852
android.view.Choreographer in doFrame at line 787
android.view.Choreographer$FrameDisplayEventReceiver in run at line 1014
android.os.Handler in handleCallback at line 883
android.os.Handler in dispatchMessage at line 100
android.os.Looper in loop at line 214
android.app.ActivityThread in main at line 7397
java.lang.reflect.Method in invoke
com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run at line 492
com.android.internal.os.ZygoteInit in main at line 935
```