Fixed
Status Update
Comments
jo...@google.com <jo...@google.com>
sh...@google.com <sh...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 021178d3ade7f9312d54805d1e2fb8a51691ce53
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Fri Oct 20 15:35:48 2023
Expose `startDragImmediately` in AnchoredDraggable
Instead of passing `startDragImmediately` to Draggable depending only on whether there is animation happening or not, `startDragImmediately` is exposed in AnchoredDraggable. This gives the ability to prevent catching widgets while they are animating and would be used by APIs that use AnchoredDraggable, such as `Switch` in Material.
Fixes: 285139987
Test: Added tests to verify behavior
Relnote: Exposing `startDragImmediately` in AnchoredDraggable gives control for detecting dragging gestures when using it. It is useful to set it when the widget is animating to a target anchor. See [Sample](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/AnchoredDraggableSample.kt?q=java%2Fandroidx%2Fcompose%2Ffoundation%2Fsamples%2FAnchoredDraggableSample.kt#:~:text=AnchoredDraggableCatchAnimatingWidgetSample ).
Change-Id: Ie6d134277bb4f25bbab7ff1929d59bba00ede235
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/AnchoredDraggableDemo.kt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/AnchoredDraggableSample.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableGestureTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
https://android-review.googlesource.com/2796081
Branch: androidx-main
commit 021178d3ade7f9312d54805d1e2fb8a51691ce53
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Fri Oct 20 15:35:48 2023
Expose `startDragImmediately` in AnchoredDraggable
Instead of passing `startDragImmediately` to Draggable depending only on whether there is animation happening or not, `startDragImmediately` is exposed in AnchoredDraggable. This gives the ability to prevent catching widgets while they are animating and would be used by APIs that use AnchoredDraggable, such as `Switch` in Material.
Fixes: 285139987
Test: Added tests to verify behavior
Relnote: Exposing `startDragImmediately` in AnchoredDraggable gives control for detecting dragging gestures when using it. It is useful to set it when the widget is animating to a target anchor. See [Sample](
Change-Id: Ie6d134277bb4f25bbab7ff1929d59bba00ede235
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/AnchoredDraggableDemo.kt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/AnchoredDraggableSample.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/anchoredDraggable/AnchoredDraggableGestureTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
Description
If we expose startDragImmediately, then for components like switch we can just set this to be false, as you don't want to be able to catch the thumb while it is in progress
It's possible that this is related to