Remove calls to LM.getItemCount in demos.

Bug: 15410611
Change-Id: Ie31616f792501f29fbb9e68f742563fbb1cde0ca
This commit is contained in:
Yigit Boyar
2014-06-12 15:58:16 -07:00
parent 9e66bc405f
commit c77710e3eb
2 changed files with 4 additions and 4 deletions

View File

@@ -286,7 +286,7 @@ public class AnimatedRecyclerView extends Activity {
final int scrollBy = -Math.min(dy - scrolled, hangingBottom);
scrolled -= scrollBy;
offsetChildrenVertical(scrollBy);
if (scrolled < dy && getItemCount() > mFirstPosition + getChildCount()) {
if (scrolled < dy && state.getItemCount() > mFirstPosition + getChildCount()) {
View v = recycler.getViewForPosition(mFirstPosition + getChildCount());
final int top = getChildAt(getChildCount() - 1).getBottom();
addView(v);
@@ -332,7 +332,7 @@ public class AnimatedRecyclerView extends Activity {
}
}
if (direction == View.FOCUS_DOWN || direction == View.FOCUS_FORWARD) {
while (mFirstPosition + getChildCount() < getItemCount() &&
while (mFirstPosition + getChildCount() < state.getItemCount() &&
newViewsHeight < mScrollDistance) {
View v = recycler.getViewForPosition(mFirstPosition + getChildCount());
final int top = getChildAt(getChildCount() - 1).getBottom();

View File

@@ -176,7 +176,7 @@ public class RecyclerViewActivity extends Activity {
final int scrollBy = -Math.min(dy - scrolled, hangingBottom);
scrolled -= scrollBy;
offsetChildrenVertical(scrollBy);
if (scrolled < dy && getItemCount() > mFirstPosition + getChildCount()) {
if (scrolled < dy && state.getItemCount() > mFirstPosition + getChildCount()) {
View v = recycler.getViewForPosition(mFirstPosition + getChildCount());
final int top = getDecoratedBottom(getChildAt(getChildCount() - 1));
addView(v);
@@ -222,7 +222,7 @@ public class RecyclerViewActivity extends Activity {
}
}
if (direction == View.FOCUS_DOWN || direction == View.FOCUS_FORWARD) {
while (mFirstPosition + getChildCount() < getItemCount() &&
while (mFirstPosition + getChildCount() < state.getItemCount() &&
newViewsHeight < mScrollDistance) {
View v = recycler.getViewForPosition(mFirstPosition + getChildCount());
final int top = getDecoratedBottom(getChildAt(getChildCount() - 1));