Skip to content

refactor: replace deprecated forEachGesture with awaitEachGesture#344

Open
saadkhalidkhan wants to merge 5 commits into
aclassen:mainfrom
saadkhalidkhan:fix/await-each-gesture
Open

refactor: replace deprecated forEachGesture with awaitEachGesture#344
saadkhalidkhan wants to merge 5 commits into
aclassen:mainfrom
saadkhalidkhan:fix/await-each-gesture

Conversation

@saadkhalidkhan

Copy link
Copy Markdown

Summary

  • Adds eachGestureWhileActive for the channel-based drag loop in Reorderable.kt where arbitrary suspend calls (channel receive) are required
  • Migrates detectReorder and detectReorderAfterLongPress to awaitEachGesture
  • Adds an AwaitPointerEventScope overload for long-press detection so it works inside awaitEachGesture

Closes #253

Commits

  1. eachGestureWhileActive helper (forEachGesture replacement)
  2. AwaitPointerEventScope long press overload
  3. Migrate detectReorder to awaitEachGesture
  4. Migrate detectReorderAfterLongPress to awaitEachGesture
  5. Replace forEachGesture in Reorderable.kt

Test plan

  • ./gradlew :reorderable:compileKotlinJvm passes with no deprecation warnings
  • ./gradlew :android:assembleDebug passes
  • Manual drag-and-drop reorder in sample app (list + grid)

@saadkhalidkhan saadkhalidkhan force-pushed the fix/await-each-gesture branch from 84f8e0f to 14af6b4 Compare June 18, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

forEachGesture deprecated

1 participant