Status Update
Comments
ha...@google.com <ha...@google.com>
ma...@google.com <ma...@google.com> #2
Thanks! This looks like a bug, thank you for reporting!
vy...@gmail.com <vy...@gmail.com> #3
Dragging up to 10% or between 50% and 90% will cause it to snap back to the start anchor.
Dragging between 10% and 50% or past 90% will cause it to snap to the end anchor.
xo...@affirm.com <xo...@affirm.com> #4
Project: platform/frameworks/support
Branch: androidx-main
Author: Jossi Wolf <
Link:
Update AnchoredDraggable target calculation logic
Expand for full commit details
Update AnchoredDraggable target calculation logic
We were previously relying on currentValue and the next closest anchor in the drag direction, but the simpler and more reliable way is to look at the left and right anchors as the window.
Relnote: Fixed a bug where positional thresholds passed to AnchoredDraggableDefaults.flingBehavior were not considered correctly in some scenarios.
Test: anchoredDraggable_fling_offsetPastHalfwayBetweenAnchors_beforePosThreshold_doesntAdvance
Bug: 367660226
Bug: 366003852
Change-Id: Ifdf0dfcf3d7ff8288affee56e7092bbed473d6ab
Files:
- M
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableStateTest.kt
- D
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableTestState.kt
- M
compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
Hash: eff53304942e9fd4fa5382e0cf487a734c5b8d28
Date: Thu Sep 19 16:24:55 2024
vy...@gmail.com <vy...@gmail.com> #5
b....@fetchrewards.com <b....@fetchrewards.com> #6
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.8.0-alpha04
androidx.compose.foundation:foundation-android:1.8.0-alpha04
androidx.compose.foundation:foundation-jvmstubs:1.8.0-alpha04
vy...@gmail.com <vy...@gmail.com> #7
Using the new version 1.8.0-alpha04
does not seem to resolve the issue for me. I tested with the same setting as the reported issue:
// it doesn't matter what you put here a the multiplier, the positionalThreshold is always 50%
positionalThreshold = { d -> d * 0.9f },
velocityThreshold = { Float.POSITIVE_INFINITY },
ch...@gmail.com <ch...@gmail.com> #8
Same. I've run this again on 1.8.0-alpha04. When using
positionalThreshold = { d -> d * 0.1f }
Dragging up to 10% or between 50% and 90% will cause it to snap back to the start anchor. Dragging between 10% and 50% or past 90% will cause it to snap to the end anchor.
I would expect It to only return if dragged less than or equal to 10% and snap to the end if dragged greater than 10%.
When using
positionalThreshold = { d -> d * 0.9f }
It acts as if the threshold has been set to 50%.
From what I can tell, nothing has changed about the behavior.
vy...@gmail.com <vy...@gmail.com> #9
Thanks, we will investigate and update this issue.
ch...@gmail.com <ch...@gmail.com> #10
vy...@gmail.com <vy...@gmail.com> #11
Project: platform/frameworks/support
Branch: androidx-main
Author: Jossi Wolf <
Link:
Update AnchoredDraggable target calculation logic
Expand for full commit details
Update AnchoredDraggable target calculation logic
There was a missed case when the velocity was negative.
Test: New tests with more parameter permutations
Fixes: 367660226
Bug: 376931805
Relnote: "Follow-up fix for an issue in AnchoredDraggable's target calculation where it could settle at the wrong anchor for specific swipes."
Change-Id: I23b8773d3a694aa3c8de6a8f34b9d7fb54cfe560
Files:
- M
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableStateTest.kt
- M
compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
Hash: 6a23aa4ee37ba171475e4155db0d24c90b358c7e
Date: Fri Nov 08 14:11:31 2024
ap...@google.com <ap...@google.com> #12
What is the fix version?
ap...@google.com <ap...@google.com> #13
We will comment on the issue when it has been included in a release. Until then, you can try the snapshot versions from androidx.dev.
ni...@niccoloforlini.com <ni...@niccoloforlini.com> #14
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.8.0-alpha07
androidx.compose.foundation:foundation-android:1.8.0-alpha07
androidx.compose.foundation:foundation-jvmstubs:1.8.0-alpha07
androidx.compose.foundation:foundation-linuxx64stubs:1.8.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
```