title: How to create a drag gesture in any direction in Android Jetpack Compose
body: <p>I want to detect a gesture in <em>@Composable</em>, which will allow me to drag an element across the screen in any direction.</p>
  <p>I tried using <em>LongPressDragObserver</em> but after dragging for a bit, it snaps to a single <em>Orientation</em> (either <em>Horizontally</em> or <em>Vertically</em>) and <em>Offset</em> doesn't change for the other <em>Orientation</em> at all (it will equal to 0 all the time)</p>
  <p>Example functionality I want to achieve:<br />
  Long press on the FAB and drag it around the screen so that it's position is constantly under user's finger.</p>
  <p>I'm using Compose <em><strong>1.0.0-alpha04</strong></em></p>
  <p>Example code which drags in only one direction (thanks to <a href="https://stackoverflow.com/users/5430306/rafsanjani">Rafsanjani</a>)</p>
  <pre><code>.dragGestureFilter(dragObserver = object : DragObserver { 
    override fun onDrag(dragDistance: Offset): Offset { 
      val newX = dragDistance.x + verticalOffset.value 
      val newY = dragDistance.y + horizontalOffset.value 
      verticalOffset.value = newX 
      horizontalOffset.value = newY 
      return dragDistance 
    } 
  })
  </code></pre>