Have you tried setting your OnTouchEventListener on each grid item view 
created by your adapter, instead of setting it on your gridview? You would 
only need to recognize the enter and leave events for each item and change 
your adapter accordingly by adding / removing a blank view at that item's 
position.

I did not try that approach yet. Let me know if it works

On Wednesday, December 19, 2012 3:23:49 AM UTC-6, Frank wrote:
>
> I created a drag and drop gridview (using an 'OnDragListener'). Grid items 
> can be dropped upon one another. However, I also want to be able to 
> re-order them. I implemented this, but there is a major issue left standing:
>
> When I drag around my shadow object I want the items to make space for my 
> dragged object while I am dragging it around. I already implemented the 
> moving of the other items, but I cannot seem to figure out a way to find 
> out IF/WHEN I am in between two items. I get drag events when I hoover 
> ABOVE an item, but not in between then. The gridview does not get any 
> 'onTouchEvent' calls when I am dragging, not even 'onInterceptTouchEvent' 
> calls.
>
> Does anyone know a way in which I can implement this? 
>
> I already tried:
>
> 1. Implementing 'onTouchEvent' and 'onInterceptTouchEvent' in the 
> gridview. Problem: 
> The gridview does not get any 'onTouchEvent' calls when I am dragging an 
> item, not even 'onInterceptTouchEvent' calls.
>
> 2. Setting another 'draglistener' on the whole gridview. Problem: 
> 'ACTION_DRAG_LOCATION' gets only called a few times, not on every move 
> (location change), as is documented (!!).

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to