Swipecards icon indicating copy to clipboard operation
Swipecards copied to clipboard

Showing less cards than adapter count

Open FelipeRRM opened this issue 9 years ago • 1 comments

When I ask my server for more cards inside onAdapterAboutToEmpty, I set a call-back to update the adapter with the new cards I received from the server: I add the data to na array inside the adapter and call adapter.notifyDataSetChanged(), but something is quite not right, because the cards on my stack end, and I still have data on my adapter. Also when I only have 2 cards, I can't move the upper card, the touch event stops working.

FelipeRRM avatar Aug 12 '15 17:08 FelipeRRM

I tried all these things, and they don't work:

            adapter.addNewCardsAndUpdateDuplicates(adapterData);
            adapter.notifyDataSetChanged();
            flingContainer.forceLayout();
            flingContainer.invalidate();
            flingContainer.requestLayout();

flingContainer is my SwipeFlingAdapterView;

If my Adapter has only 2 cards, and the server sends me 5 new cards (they are in the adapterData), I use the method I created inside the adapter to update the array, and then I call those methods of the view, to try and make it update, but it still only shows me the 2 cards! How to make them show all the new cards?

FelipeRRM avatar Aug 13 '15 14:08 FelipeRRM