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
protectedvoidapplyAndAnimateAdditions(List<T> from, List<T> newItems) {
intout = 0;
for (inti = 0, count = newItems.size(); i < count; i++) {
finalTitem = newItems.get(i);
if (!from.contains(item)) {
if (DEBUG) Log.v(TAG, "animateAdditions add position=" + i + " item=" + item);
from.add(i, item);
notifyItemInserted(i);
} elseif (mNotifyChangeOfUnfilteredItems) {
out++;
notifyItemChanged(i, mNotifyChangeOfUnfilteredItems);
if (DEBUG) Log.v(TAG, "animateAdditions keep position=" + i + " item=" + item);
}
}
if (DEBUG) Log.v(TAG, "animateAdditions total out=" + out + " in=" + newItems.size());
}
so if old array does not contains item, you add it and notify adapter, otherwise you just notifying that item was updated, but from list does not receive that updated item. Think needs to call smth. like from.set(i, item) before calling notifyItemChanged(i, mNotifyChangeOfUnfilteredItems);
The text was updated successfully, but these errors were encountered:
vverbytskyi10
changed the title
Item does not updated after updateDataSet()
[5.0.0-b6] Item does not updated after updateDataSet()
Jun 2, 2016
@vverbitskyy, at the beginning this method was used only for filtering purpose, than I saw that could be used also for any update, but I think you could be right. To be sincere I did not test updateDataSet() when items are modified from code.
I will check and eventually fix it.
Think there is an issue at the method
so if old array does not contains item, you add it and notify adapter, otherwise you just notifying that item was updated, but from list does not receive that updated item. Think needs to call smth. like from.set(i, item) before calling notifyItemChanged(i, mNotifyChangeOfUnfilteredItems);
The text was updated successfully, but these errors were encountered: