Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-27 UTC."],[],[],null,["Drag2DScope \nArtifact: [androidx.compose.foundation:foundation](/jetpack/androidx/releases/compose-foundation) \n[View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/gestures/Draggable2D.kt+class:androidx.compose.foundation.gestures.Drag2DScope) \nAdded in [1.6.0](/jetpack/androidx/releases/compose-foundation#1.6.0)\nCommon/AllAndroid/JVM\n - Cmn \n\n ```\n interface Drag2DScope\n ```\n\n*** ** * ** ***\n\nScope used for suspending drag blocks\n\nSummary \n\n| Public functions |\n|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|\n| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [dragBy](/reference/kotlin/androidx/compose/foundation/gestures/Drag2DScope#dragBy(androidx.compose.ui.geometry.Offset))`(pixels: `[Offset](/reference/kotlin/androidx/compose/ui/geometry/Offset)`)` Attempts to drag by [pixels](/reference/kotlin/androidx/compose/foundation/gestures/Drag2DScope#dragBy(androidx.compose.ui.geometry.Offset)) px. | Cmn |\n\nPublic functions \n\ndragBy \nCmn \nAdded in [1.10.0-alpha02](/jetpack/androidx/releases/compose-foundation#1.10.0-alpha02) \n\n```\nfun dragBy(pixels: Offset): Unit\n```\n\nAttempts to drag by [pixels](/reference/kotlin/androidx/compose/foundation/gestures/Drag2DScope#dragBy(androidx.compose.ui.geometry.Offset)) px."]]