Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
Conflicts:
	gradle.properties
  • Loading branch information
leruaa committed Nov 2, 2014
2 parents 6ddabc7 + 462d996 commit 774c98d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

VERSION_NAME=0.4.2

VERSION_NAME=0.4.3
GROUP=com.eowise
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ public void onChanged() {
public void onItemRangeRemoved(int positionStart, int itemCount) {
headerStore.onItemRangeRemoved(positionStart, itemCount);
}

@Override
public void onItemRangeInserted(int positionStart, int itemCount) {
headerStore.onItemRangeInserted(positionStart, itemCount);
}
}

private class HeaderStore {
Expand Down Expand Up @@ -173,6 +178,23 @@ public void onItemRangeRemoved(int positionStart, int itemCount) {
cleanOffScreenItemsIds();
}

public void onItemRangeInserted(int positionStart, int itemCount) {
boolean isCleanOffScreenItemsIdsNeeded = false;
for (int i = 0; i <= itemCount; i++) {
RecyclerView.ViewHolder holder = parent.findViewHolderForPosition(positionStart + i);
if (holder != null) {
isHeadersByItemsIds.remove(holder.getItemId());
}
else {
isCleanOffScreenItemsIdsNeeded = true;
}
}

if (isCleanOffScreenItemsIdsNeeded) {
cleanOffScreenItemsIds();
}
}

public void clear() {
headersViewByHeadersIds.clear();
isHeadersByItemsIds.clear();
Expand Down

0 comments on commit 774c98d

Please # to comment.