Swipe_RecyclerView icon indicating copy to clipboard operation
Swipe_RecyclerView copied to clipboard

swiping empty recycler causes crash

Open ericcumbee opened this issue 11 years ago • 6 comments

Just playing with my app, i noticed that if you swipe an empty swiperecycler it crashes with

java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1 at java.util.ArrayList.get(ArrayList.java:310) at com.fortysevendeg.swipelistview.SwipeListViewTouchListener.closeOtherOpenedItems(SwipeListViewTouchListener.java:997) at com.fortysevendeg.swipelistview.SwipeListViewTouchListener.onTouch(SwipeListViewTouchListener.java:985)

I can post additional code/details tomorrow, but just wanted to put this in before I forgot.

ericcumbee avatar Dec 02 '14 08:12 ericcumbee

I will look into it and update it. Was just too busy, so took time to notice the issue. Thanks.

rahulrj avatar Dec 25 '14 10:12 rahulrj

Hi Rahulrj,

It would be great if you could find some time to fix this issue.

In the meanwhile, I added the following quick fix in " in closeOpenedItems() and closeOtherOpenedItems() methods of your lib and recompiled it locally : "if (start==-1) return;"

Also could you please add this lib in a Marven repo and if possible use versions.

Thanks in Advance.

u2gilles avatar Jan 11 '15 05:01 u2gilles

Okay. Will do on the coming Thursday as its a holiday.

rahulrj avatar Jan 13 '15 16:01 rahulrj

Good. I'm afraid my fix has side effects . Better a clean fix from the designer

Sent from Samsung Mobile.

-------- Original message --------
From: RAHUL RAJA [email protected]
Date:13/01/2015 23:51 (GMT+07:00)
To: rahulrj/Swipe_RecyclerView [email protected]
Cc: u2gilles [email protected]
Subject: Re: [Swipe_RecyclerView] swiping empty recycler causes crash (#3)
Okay. Will do on the coming Thursday as its a holiday.

— Reply to this email directly or view it on GitHub.

u2gilles avatar Jan 13 '15 17:01 u2gilles

I am running into the same issue. Attempting to figure out a fix though do not seem to be succeeding.

01-18 23:10:29.329 1264-1264/com.drinkapp.drink E/MessageQueue-JNI﹕ Exception in MessageQueue callback: handleReceiveCallback 01-18 23:10:29.349 1264-1264/com.drinkapp.drink E/MessageQueue-JNI﹕ java.lang.IndexOutOfBoundsException: Invalid index 1, size is 1 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) at java.util.ArrayList.get(ArrayList.java:308) at com.fortysevendeg.swipelistview.SwipeListViewTouchListener.closeOtherOpenedItems(SwipeListViewTouchListener.java:1000) at com.fortysevendeg.swipelistview.SwipeListViewTouchListener.onTouch(SwipeListViewTouchListener.java:986)

bvanhou avatar Jan 19 '15 04:01 bvanhou

We may not use the lib in the same way. I recommend you to use a debugger and notice that when start==-1, it crashed. Then add your own fix to make it works until Rahulrj provides the final patch. .

u2gilles avatar Jan 19 '15 04:01 u2gilles