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?
Asked
Active
Viewed 1,449 times
16
-
Are you performing drag & drop on gridview or listview? – Dipak Keshariya Jul 02 '12 at 11:28
-
No... its just on a GestureOverlayView ... – Droid_Dev Jul 02 '12 at 11:36
-
Make sure the parent of the layout is Relative layout and not the Linear layout. – AkashG Jul 07 '12 at 04:52
3 Answers
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
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