16

Is it possible to add a layout in a gestureOverlay view and Drag Drop it in a desired position in android. I am able to add a layout but not able to drag and drop it..I want to know is it possible to do this in version 2.2?

Droid_Dev
  • 1,162
  • 1
  • 8
  • 25

3 Answers3

4

thanks for the help... myself found a solution for this problem... i couldn't implement a drag on this layout, But i adjust in such a way that the layout will come into the position where i touch on the screen... thanks....

private void RunAnimations(MotionEvent event) {

        lastX = event.getX();
        lastY = event.getY();
        Animation b = new TranslateAnimation(Animation.ABSOLUTE,lastX,Animation.ABSOLUTE,event.getX(),Animation.ABSOLUTE,lastY-57,Animation.ABSOLUTE,event.getY()-57);             
        rl.startAnimation(b);  
        b.setFillAfter(true);
    } 
Droid_Dev
  • 1,162
  • 1
  • 8
  • 25
1

Check out this library: android-dragarea

Ivan Bartsov
  • 19,664
  • 7
  • 61
  • 59
1

We implemented a simulare behavior but we derived from ViewGroup and made most of the code by ourself. We also had to use android.support.v4.view to make it work for 2.2

giZm0
  • 1,481
  • 21
  • 37