Skip to content

Commit

Permalink
Bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
javipacheco committed Feb 19, 2013
1 parent 8d93210 commit d6a6282
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
package com.fortysevendeg.android.swipelistview;

import android.graphics.Rect;
import android.os.Handler;
import android.view.*;
import android.widget.AbsListView;
import android.widget.ListView;
Expand Down Expand Up @@ -48,6 +49,8 @@ public class SwipeListViewTouchListener implements View.OnTouchListener {
private int swipeFrontView = 0;
private int swipeBackView = 0;

private Rect rect = new Rect();

// Cached ViewConfiguration and system-wide constant values
private int slop;
private int minFlingVelocity;
Expand Down Expand Up @@ -416,10 +419,16 @@ public void onScrollStateChanged(AbsListView absListView, int scrollState) {
}
if (scrollState==SCROLL_STATE_TOUCH_SCROLL) {
listViewMoving = true;
setEnabled(false);
}
if (scrollState != AbsListView.OnScrollListener.SCROLL_STATE_FLING && scrollState != SCROLL_STATE_TOUCH_SCROLL) {
listViewMoving = false;
swipeListView.resetScrolling();
new Handler().postDelayed(new Runnable() {
public void run() {
setEnabled(true);
}
}, 500);
}
}

Expand Down Expand Up @@ -460,7 +469,7 @@ public boolean onTouch(View view, MotionEvent motionEvent) {
return false;
}
swipeCurrentAction = SwipeListView.SWIPE_ACTION_NONE;
Rect rect = new Rect();

int childCount = swipeListView.getChildCount();
int[] listViewCoords = new int[2];
swipeListView.getLocationOnScreen(listViewCoords);
Expand Down Expand Up @@ -526,6 +535,7 @@ public boolean onTouch(View view, MotionEvent motionEvent) {
}
generateAnimate(frontView, swap, swapRight, downPosition);

velocityTracker.recycle();
velocityTracker = null;
downX = 0;
// change clickable front view
Expand Down

0 comments on commit d6a6282

Please sign in to comment.