Merge pull request #15 from amenon/fix_accidental_open

Fixing accidental open when in a scroll view
This commit is contained in:
代码家 2014-09-02 07:40:29 +08:00
commit 54f6a18587
2 changed files with 4 additions and 6 deletions

View File

@ -78,11 +78,9 @@ public abstract class SwipeAdapter extends BaseAdapter {
* @param mode
*/
public void setMode(Mode mode){
if(mode == Mode.Multiple){
mOpenPositions.clear();
}else{
mOpenPosition = INVALID_POSITION;
}
// Clear currently set values
mOpenPositions.clear();
mOpenPosition = INVALID_POSITION;
this.mode = mode;
notifyDataSetChanged();
}

View File

@ -930,7 +930,7 @@ public class SwipeLayout extends FrameLayout {
*/
private void processSurfaceRelease(float xvel, float yvel){
if(xvel == 0 && getOpenStatus() == Status.Middle)
open();
close();
if(mDragEdge == DragEdge.Left || mDragEdge == DragEdge.Right){
if(xvel > 0){