am 7e5e3745: Fix bug 2710825 - Prevent ExpandableListView from scrolling too far when expanding children.

Merge commit '7e5e3745cf0103219a13071fbd488c3c01da85d9' into froyo-plus-aosp

* commit '7e5e3745cf0103219a13071fbd488c3c01da85d9':
  Fix bug 2710825 - Prevent ExpandableListView from scrolling too far when expanding children.
This commit is contained in:
Adam Powell
2010-05-24 16:23:53 -07:00
committed by Android Git Automerger

View File

@@ -2645,7 +2645,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
mScrollDuration);
mLastSeenPos = lastPos;
if (lastPos != mTargetPos) {
if (lastPos < mTargetPos) {
post(this);
}
break;
@@ -2671,7 +2671,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
final int nextViewHeight = nextView.getHeight();
final int nextViewTop = nextView.getTop();
final int extraScroll = mExtraScroll;
if (nextPos != mBoundPos) {
if (nextPos < mBoundPos) {
smoothScrollBy(Math.max(0, nextViewHeight + nextViewTop - extraScroll),
mScrollDuration);
@@ -2704,7 +2704,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
mLastSeenPos = firstPos;
if (firstPos != mTargetPos) {
if (firstPos > mTargetPos) {
post(this);
}
break;
@@ -2728,7 +2728,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
final int lastViewTop = lastView.getTop();
final int lastViewPixelsShowing = listHeight - lastViewTop;
mLastSeenPos = lastPos;
if (lastPos != mBoundPos) {
if (lastPos > mBoundPos) {
smoothScrollBy(-(lastViewPixelsShowing - mExtraScroll), mScrollDuration);
post(this);
} else {