am a0abe266: Merge "Fixing crash when updating the scroll position state when there are no items." into ub-launcher3-burnaby

* commit 'a0abe2661eaf4f8e66990ac68386e54260836183':
  Fixing crash when updating the scroll position state when there are no items.
This commit is contained in:
Winson Chung
2015-05-14 19:39:38 +00:00
committed by Android Git Automerger
@@ -497,6 +497,12 @@ public class AppsContainerRecyclerView extends BaseContainerRecyclerView {
stateOut.rowIndex = -1;
stateOut.rowTopOffset = -1;
stateOut.rowHeight = -1;
// Return early if there are no items
if (items.isEmpty()) {
return;
}
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);