Fixed a bug in DraggableListView that would fire click events for cancelled motion events

pull/14/head
Sam Bosley 13 years ago
parent 8d2c19c859
commit a0c2d7b7f5

@ -254,6 +254,7 @@ public class DraggableListView extends ListView {
if (dragThread != null && mClickListener != null) { if (dragThread != null && mClickListener != null) {
dragThread.interrupt(); dragThread.interrupt();
dragThread = null; dragThread = null;
if (action == MotionEvent.ACTION_UP)
mClickListener.onClick(viewAtPosition()); mClickListener.onClick(viewAtPosition());
} }
@ -482,7 +483,6 @@ public class DraggableListView extends ListView {
unExpandViews(false); unExpandViews(false);
if (mDragView != null) { if (mDragView != null) {
System.err.println("removing view");
WindowManager wm = (WindowManager) getContext().getSystemService( WindowManager wm = (WindowManager) getContext().getSystemService(
Context.WINDOW_SERVICE); Context.WINDOW_SERVICE);
wm.removeView(mDragView); wm.removeView(mDragView);

Loading…
Cancel
Save