Closed IOException722 closed 7 years ago
If you do not call .remove(), the card will come back to top again. If I understanding the question right this should solve your issue.
I solved the issue by setting the adapter again on whole card array list
Hey , I am saving the top card in a temporary variable in Left and Right Exit (calling an api in each left or right method) and in OnSuccess of the api call, I am adding back that temporary card on top of the stack according to a certain condition.
For first swipe top card getting removed and not coming back on top of the stack. On second swipe top card can come on top of the card stack after getting removed while swiping.
Saving the top card in left exit method before api call onLeftExit() { tempJobList = cards.get(0); cards.remove(0); adapter.notifyDataSetChanged(); api call }
Adding back on top of the stack In onSuccess() { cards.add(0, tempJobList); adapter.notifyDataSetChanged(); }
I checked the size of the cards and its consistent before removing a after adding the card. I tried different algo but for first swipe card is not coming back on stack.Can you tell me what it the problem ?