SwipeListView
SwipeListView copied to clipboard
listView.addHeaderView(normalHeaderView);
listView.addHeaderView(normalHeaderView);
swipe wrong.you can try it.
when i swipe position o it will show i swipe item 1. how to solve it ??? Thanks.
Wow, I have touched this library for a while.
I think the problem comes from this code in SwipeToDeleteListView.java
:
private void setDraggedItem(MotionEvent event) {
int position = pointToPosition((int) event.getX(), (int) event.getY());
ItemState itemState = adapter.getItemState(position);
if(itemState != null && itemState.getState() == State.Normal) {
draggedItemPosition = position;
itemState.setState(State.Dragged);
}
}
pointToPosition
might take into account headers and it shouldn't.
Could you investigate and post a Pull Request if you find a solution ?
YES。you got it. i also solved it. thanks.
Could you post a PR or the code to solve this issue ?
sorry,i only update this code on my project, maybe you can change here: int position = pointToPosition((int) event.getX(), (int) event.getY()); you know ,when user add HeaderView .the item position will start 1,but the HeaderView not allow to swipe,so you can just update code here.(such as :position -= 1//if the view has HeaderView.) That's my solution. Thanks.