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
After setAdapter(), add a card to the adapter using the adapter's add(), which internally will call notifyDataSetChange(). However, after this point, the card cannot be swiped.
The problem lies in mTopCard being set to null when adapter nofityDataSetChange() gets called, the CardContainer's data listener onChanged() calls clearStack() which clears sets mTopCard = null.
After that mTopCard is always null unless setAdapter() is called again, which shouldn't have to be.
to ensureFull() which is just the line above. This will ensure that notifyDataSetChange() will work as intended without having to call setAdapter() again (which the code shouldn't have access to the view element to call).
The text was updated successfully, but these errors were encountered:
hong-yew
changed the title
Cards can't be swiped when change are made after setAdapter()
Cards can't be swiped when changes are made after setAdapter()
Dec 22, 2015
To reproduce:
After setAdapter(), add a card to the adapter using the adapter's add(), which internally will call notifyDataSetChange(). However, after this point, the card cannot be swiped.
The problem lies in mTopCard being set to null when adapter nofityDataSetChange() gets called, the CardContainer's data listener onChanged() calls clearStack() which clears sets mTopCard = null.
After that mTopCard is always null unless setAdapter() is called again, which shouldn't have to be.
Suggest to move the code in setAdapter()
to ensureFull() which is just the line above. This will ensure that notifyDataSetChange() will work as intended without having to call setAdapter() again (which the code shouldn't have access to the view element to call).
The text was updated successfully, but these errors were encountered: