Swipecards
Swipecards copied to clipboard
Top card doesn't change on NotifyDataSetChanges
I am using an arraylist in my adapter as the data source for the cards. On a button toggle, I have to change the cards displayed. Hence I call the clear()
function of my array and then do an addAll()
with the required data. Followed by a call to the adapters notifyDataSetChanged()
The data does change but the first card is the same as what i saw before the button toggle. on swiping away this card I see that the next card is the second card of my second list(and same for the 3rd,4th etc hence I conclude the data has changed). But why didn't the first card refresh to show the new list?
Same issue
current workaround is adding a blank page onto the first page and call selectRight()
I have the same issue also
I resolved this issue by adding this method in SwipeFlingAdapterView
public void reset() {
this.mActiveCard = null;
requestLayout();
}
Just call reset()
when you need to reset the SwipeFlingAdapterView
I solved this by using flingContainer.removeAllViewsInLayout();
Nice Solution for toggle card that is already left
Also got this issue on version 1.0.8.
Workaround flingContainer.removeAllViewsInLayout();
before notifyDataSetChanged()
worked aswell, no need to change lib's code.
removeAllViewsInLayout worked for me too, thanks :smile:
@Diolor : Can you please add this in the Readme of this library? It will be really helpful since I feel it's one of the very common operations that people would be looking for
Was using selectRight() earlier But removeAllViewsInLayout() is pretty neat workaround. Thanks
+1 for flingContainer.removeAllViewsInLayout();
When I use removeAllViewsInLayout()
, I currently have the issue that the flingadapter is either not showing images, or swiping does not work until I press the button I have for swiping left/right, so triggering it manually