-
Notifications
You must be signed in to change notification settings - Fork 2.7k
remove an listview item in swipeadater? #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you show me you adapter code? |
public class CircleAdapter extends SwipeAdapter {
} |
The following is the exception I got. Seems it's related with wrong position value... FATAL EXCEPTION: main |
Hey guy, please move the following code to swipeLayout.addSwipeListener(new SwipeLayout.SwipeListener() {
@Override
public void onClose(SwipeLayout layout) {
//when the SurfaceView totally cover the BottomView.
}
@Override
public void onUpdate(SwipeLayout layout, int leftOffset, int topOffset) {
//you are swiping.
}
@Override
public void onOpen(SwipeLayout layout) {
//when the BottomView totally show.
//Log.d("Position @ onOpen", Integer.toString(position));
mPictures.remove(position);
notifyDataSetChanged();
}
@Override
public void onHandRelease(SwipeLayout layout, float xvel, float yvel) {
//when user's hand released.
} the reason is here #14 |
have a try and give me feedback. |
BTW. you can use |
Thanks for quick reply. I still got java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 . |
hi, this is |
You are right. seems getView will add a default swipeMemory...? I put a removeAllSwipeListener() before add my own swipeListener and now it's working. Huge thanks! |
Great ! |
I think I should remove |
if I put remove item logic in onOpen method, I got null pointer exception from time to time. If I put that into button onclicklistener, it'll be fine. |
Because i ran into same issues, my question, what is the answer to this ? |
Hey guys, so there's definitely some problem with this: I used the code given in a sample (demo folder): fifth: so sorry, for now I didn't get it to work constantly. at least on 15 deletions, one makes some broken state :( btw: using android L on a Nexus 5 |
Hi, When I’m using Kitkat Version . If i swipe the list item, delete & open button appeared and suddenly its closed .(Your Demo Application also same )other versions its working good . Your Application Link : https://github.com/daimajia/AndroidSwipeLayout/releases/download/v1.1.8/AndroidSwipeLayout-v1.1.8.apk Please help me |
Hey,
} I think correctly solving this problem is to have Set instead of List inside SwipeLayout. I hope it will be fixed soon. |
I have a horizontal list view and for each item I want to delete it with swipe gesture. I put the delete logic in onOpen method, but seems it's not working.
The text was updated successfully, but these errors were encountered: