You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I double click on a card and swipe (even sometimes one click and swipe), I get a null pointer exception in the onScroll method. Tried removing it and now when I do a double click and swipe, two cards disappear at once. The error I got was:
It seems like a really simple bug, but it is annoying and I would like some help on how I can fix it. Looks like the removeFirstObjectInAdapter function get called twice. A really simple fix would be to change it to something like:
public void removeFirstObjectInAdapter() {
// this is the simplest way to delete an object from the Adapter (/AdapterView)
long time = System.currentTimeMillis();
if (time - last_delete > 200) {
Log.d("LIST", "removed object!");
al.remove(0);
last_delete = time;
}
arrayAdapter.notifyDataSetChanged();
}
However, it doesn't look very reliable. Please help me fix this?
The text was updated successfully, but these errors were encountered:
Hey @Martinch0 and thanks for reporting this. onScroll was implemented via pull request and I didn't have the time since then to optimize and test as much I would liked to do so.
I would highly refrain you from using these kind of solutions unless you really want to throttle the behavior for 200ms :)
FlingCardListener has all the logic of the animations. A simple solution with the current architecture would have been to "block" the clicks, in reality instead of blocking the clicks just "to do nothing" until the next card is fully available (probably just catching the nulls).
I have just tried out the library and it looks really cool. However, there is something that I don't like and would like to fix it. I followed the example from https://github.com/Diolor/Swipecards/blob/master/example/src/main/java/com/lorentzos/swipecards/MyActivity.java
When I double click on a card and swipe (even sometimes one click and swipe), I get a null pointer exception in the onScroll method. Tried removing it and now when I do a double click and swipe, two cards disappear at once. The error I got was:
And when I tried just to print what was happening. I got:
It seems like a really simple bug, but it is annoying and I would like some help on how I can fix it. Looks like the removeFirstObjectInAdapter function get called twice. A really simple fix would be to change it to something like:
However, it doesn't look very reliable. Please help me fix this?
The text was updated successfully, but these errors were encountered: