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
Hi,
I've faced a problem, when if boundaryCaching is set to true and notifyDataSetChanged() is called, first and last elements of viewpager become unpredictable. In my situation, after updating the viewpager current item was replaced by first element, so duplicates appeared in view pager.
I've fixed it by forcing adapter to destroy all existing toDestroy objects while doing notifyDataSetChanged(). So maybe it should be included to library too.
LoopPagerAdapterWrapper:
public void notifyDataSetChanged() {
for(int i = 0; i < mToDestroy.size(); i++){
ToDestroy value = mToDestroy.valueAt(i);
mAdapter.destroyItem(value.container, value.position, value.object);
}
mToDestroy = new SparseArray<ToDestroy>();
super.notifyDataSetChanged();
}
The text was updated successfully, but these errors were encountered:
Hi,
I've faced a problem, when if boundaryCaching is set to true and notifyDataSetChanged() is called, first and last elements of viewpager become unpredictable. In my situation, after updating the viewpager current item was replaced by first element, so duplicates appeared in view pager.
I've fixed it by forcing adapter to destroy all existing toDestroy objects while doing notifyDataSetChanged(). So maybe it should be included to library too.
LoopPagerAdapterWrapper:
The text was updated successfully, but these errors were encountered: