Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drag and Drop in a `ListView`

I am trying to implement a drag and drop in a ListView in android(Ice Cream Sandwich). So when the dragged object reaches the edge of the ListView, I am scrolling the ListView in the relevant direction. The problem is that when we scroll, sometimes the adapter creates new Views as necessary and these 'new' Views did not receive the ACTION_DRAG_STARTED event earlier and hence do not receive the DragEvent updates. Is there any way I can send the events to these views as well?

like image 958
N.R.S.Sowrabh Avatar asked Dec 06 '12 06:12

N.R.S.Sowrabh


1 Answers

An easiest way to implement drag and drop in listview is you use this great library. https://github.com/commonsguy/cwac-touchlist it's worth trying.

like image 137
wktk Avatar answered Oct 17 '22 02:10

wktk