am 95ad5c54: am 2421cd42: Merge "Fix bug 3352112 - crash in AbsListView.smoothScrollBy" into honeycomb

* commit '95ad5c54ea83832f3d71218531cb23a791f4248f':
  Fix bug 3352112 - crash in AbsListView.smoothScrollBy
This commit is contained in:
Adam Powell
2011-01-13 22:25:33 -08:00
committed by Android Git Automerger

View File

@@ -4106,8 +4106,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
final int topLimit = getPaddingTop();
final int bottomLimit = getHeight() - getPaddingBottom();
if (distance == 0 ||
firstPos == INVALID_POSITION ||
if (distance == 0 || mItemCount == 0 || childCount == 0 ||
(firstPos == 0 && getChildAt(0).getTop() == topLimit && distance < 0) ||
(lastPos == mItemCount - 1 &&
getChildAt(childCount - 1).getBottom() == bottomLimit && distance > 0)) {