Fixed
Status Update
Comments
lp...@google.com <lp...@google.com> #2
Can't remember if I filed a bug, but I ran into something similar when building the color picker demo:
This is maybe a simpler subset of this feature request, as I am not interested in fling or adjusting the offset, but only the up to date 2d position of the pointer, but maybe this is something that we would want to provide as a lower level helper to build 2d draggable anyway. Maybe an interesting thing to consider
le...@google.com <le...@google.com>
le...@google.com <le...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 8c0ca9258e7c9fc5c368b6f61e12da75cb56de88
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Wed Sep 20 18:04:00 2023
Creation of Draggable2dState for the Draggable2d modifier
A state for Draggable2d modifier is created as a first step of implementing the new API. The state is an interface with a default implementation. Two functions are also included: Draggable2dState and rememberDraggable2dState.
Bug: 214412658
Test: N/A
Change-Id: I3631dc2d5cee4001bd41779024cdd0f2d35a5e8a
A compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable2d.kt
https://android-review.googlesource.com/2759185
Branch: androidx-main
commit 8c0ca9258e7c9fc5c368b6f61e12da75cb56de88
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Wed Sep 20 18:04:00 2023
Creation of Draggable2dState for the Draggable2d modifier
A state for Draggable2d modifier is created as a first step of implementing the new API. The state is an interface with a default implementation. Two functions are also included: Draggable2dState and rememberDraggable2dState.
Bug: 214412658
Test: N/A
Change-Id: I3631dc2d5cee4001bd41779024cdd0f2d35a5e8a
A compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable2d.kt
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 9ff6dd9ba752c3c68119964c90d3be28ebde81a0
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Fri Sep 22 17:13:59 2023
Implement Draggable2d node, element, and modifier function
Draggable2dNode is implemented using AbstractDraggableNode providing the suitable behavior by implementing the abstract functions. The node was also used in the element to set up the modifier that will be used by users.
Bug: 214412658
Test: Tests will be added in a chain CL
Change-Id: I45b8f60ce602ae45cae86dbbbcd7f5debb1cd771
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable2d.kt
https://android-review.googlesource.com/2759052
Branch: androidx-main
commit 9ff6dd9ba752c3c68119964c90d3be28ebde81a0
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Fri Sep 22 17:13:59 2023
Implement Draggable2d node, element, and modifier function
Draggable2dNode is implemented using AbstractDraggableNode providing the suitable behavior by implementing the abstract functions. The node was also used in the element to set up the modifier that will be used by users.
Bug: 214412658
Test: Tests will be added in a chain CL
Change-Id: I45b8f60ce602ae45cae86dbbbcd7f5debb1cd771
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable2d.kt
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit 1885e977423a2c5c0ef6c539fc278330443ec2a2
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Mon Sep 25 17:53:58 2023
Implementation of AbstractDraggableNode
An abstract class is added to the Draggable modifier that holds the dragging logic. The class will be implemented by both DraggableNode and Draggable2dNode. It will replace the logic in the DraggableNode when the changes are applied to Draggable.
Bug: 214412658
Test: N/A
Change-Id: I287f8323c1cbaff645691707d3b3ef9c8b99b728
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt
https://android-review.googlesource.com/2759174
Branch: androidx-main
commit 1885e977423a2c5c0ef6c539fc278330443ec2a2
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Mon Sep 25 17:53:58 2023
Implementation of AbstractDraggableNode
An abstract class is added to the Draggable modifier that holds the dragging logic. The class will be implemented by both DraggableNode and Draggable2dNode. It will replace the logic in the DraggableNode when the changes are applied to Draggable.
Bug: 214412658
Test: N/A
Change-Id: I287f8323c1cbaff645691707d3b3ef9c8b99b728
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt
sh...@google.com <sh...@google.com>
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit 918e27aebdd1d9e1682846394ede9c4d5de23999
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Wed Oct 04 12:10:51 2023
Rename draggable2d to draggable2D
Refactored Draggable2D.kt file and Draggable2DTest.kt to change the name of the API to Draggable2D. This includes renaming all parts associated with the modifier (state, node, etc).
Bug: 214412658
Test: Previous tests should pass
Change-Id: Ie13218b1466e8204b1d2adcbadd3a87f4b8c753e
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/Draggable2DTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable2D.kt
https://android-review.googlesource.com/2769523
Branch: androidx-main
commit 918e27aebdd1d9e1682846394ede9c4d5de23999
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Wed Oct 04 12:10:51 2023
Rename draggable2d to draggable2D
Refactored Draggable2D.kt file and Draggable2DTest.kt to change the name of the API to Draggable2D. This includes renaming all parts associated with the modifier (state, node, etc).
Bug: 214412658
Test: Previous tests should pass
Change-Id: Ie13218b1466e8204b1d2adcbadd3a87f4b8c753e
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/Draggable2DTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable2D.kt
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
commit 421347e414e7ae8629d91296b47c11e28affb5cc
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Wed Oct 04 10:49:18 2023
Draggable2d tests
Added tests for the Draggable2d modifier.
Bug: 214412658
Test: Added test for Draggable2d modifier
Change-Id: Iac49e9fd3d73a09421b1621a0e4ffefad1df903c
A compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/Draggable2DTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/DraggableTest.kt
https://android-review.googlesource.com/2770276
Branch: androidx-main
commit 421347e414e7ae8629d91296b47c11e28affb5cc
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Wed Oct 04 10:49:18 2023
Draggable2d tests
Added tests for the Draggable2d modifier.
Bug: 214412658
Test: Added test for Draggable2d modifier
Change-Id: Iac49e9fd3d73a09421b1621a0e4ffefad1df903c
A compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/Draggable2DTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/DraggableTest.kt
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
commit 4f044d84db3002e838b4286e56b746695cb9fe4b
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Fri Oct 06 12:02:15 2023
Publish Draggable2D in Foundation
Added a sample and a benchmark test for the draggable2D modifier. These are added after making the API public as an Experimental API.
Relnote: Introduced a new `Draggable2D` API in Foundation. It can be used to give the ability for components to be dragged across the screen in 2 dimensions. See [Sample](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/Draggable2DSamples.kt )
Fixes: 214412658
Test: Existing tests should pass
Change-Id: Id95f5706cb31e2c0d4bbd17bb127f527a313df6f
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/HighLevelGesturesDemo.kt
A compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/Draggable2DSamples.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/Draggable2DTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable2D.kt
M compose/ui/ui/benchmark/src/androidTest/java/androidx/compose/ui/benchmark/ModifiersBenchmark.kt
https://android-review.googlesource.com/2775138
Branch: androidx-main
commit 4f044d84db3002e838b4286e56b746695cb9fe4b
Author: Shahd AbuDaghash <shahddaghash@google.com>
Date: Fri Oct 06 12:02:15 2023
Publish Draggable2D in Foundation
Added a sample and a benchmark test for the draggable2D modifier. These are added after making the API public as an Experimental API.
Relnote: Introduced a new `Draggable2D` API in Foundation. It can be used to give the ability for components to be dragged across the screen in 2 dimensions. See [Sample](
Fixes: 214412658
Test: Existing tests should pass
Change-Id: Id95f5706cb31e2c0d4bbd17bb127f527a313df6f
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/HighLevelGesturesDemo.kt
A compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/Draggable2DSamples.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/Draggable2DTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable2D.kt
M compose/ui/ui/benchmark/src/androidTest/java/androidx/compose/ui/benchmark/ModifiersBenchmark.kt
pr...@google.com <pr...@google.com> #9
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.6.0-alpha08
androidx.compose.foundation:foundation-android:1.6.0-alpha08
androidx.compose.foundation:foundation-desktop:1.6.0-alpha08
androidx.compose.ui:ui:1.6.0-alpha08
androidx.compose.ui:ui-android:1.6.0-alpha08
androidx.compose.ui:ui-desktop:1.6.0-alpha08
Description
There's a long standing feature request of having a 2d drag, similar to the one we have for 1d Modifier.draggable.
Right now people use their own version using lower level building blocks, but a few features will be missing in their code: InteractionSource support or mutex-based priority dragging being a few to mention.
We need to expose the right building blocks for easy wiring or provide a ready to use modifier for such cases. Seems like this issue might be a good foundation for 2d scroll as well ( b/214410040 ).
Over to Levi to start building up his backlog, but feel free to reassign to me or foundation alias if there are any questions or concerns.