Skip to content

Commit 7e5e374

Browse files
committed
Fix bug 2710825 - Prevent ExpandableListView from scrolling too far when expanding children.
Change-Id: I21b37647c5ad16e4f57fdda433e3b3ee2c7c83ad
1 parent c7c7afd commit 7e5e374

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/java/android/widget/AbsListView.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2645,7 +2645,7 @@ public void run() {
26452645
mScrollDuration);
26462646

26472647
mLastSeenPos = lastPos;
2648-
if (lastPos != mTargetPos) {
2648+
if (lastPos < mTargetPos) {
26492649
post(this);
26502650
}
26512651
break;
@@ -2671,7 +2671,7 @@ public void run() {
26712671
final int nextViewHeight = nextView.getHeight();
26722672
final int nextViewTop = nextView.getTop();
26732673
final int extraScroll = mExtraScroll;
2674-
if (nextPos != mBoundPos) {
2674+
if (nextPos < mBoundPos) {
26752675
smoothScrollBy(Math.max(0, nextViewHeight + nextViewTop - extraScroll),
26762676
mScrollDuration);
26772677

@@ -2704,7 +2704,7 @@ public void run() {
27042704

27052705
mLastSeenPos = firstPos;
27062706

2707-
if (firstPos != mTargetPos) {
2707+
if (firstPos > mTargetPos) {
27082708
post(this);
27092709
}
27102710
break;
@@ -2728,7 +2728,7 @@ public void run() {
27282728
final int lastViewTop = lastView.getTop();
27292729
final int lastViewPixelsShowing = listHeight - lastViewTop;
27302730
mLastSeenPos = lastPos;
2731-
if (lastPos != mBoundPos) {
2731+
if (lastPos > mBoundPos) {
27322732
smoothScrollBy(-(lastViewPixelsShowing - mExtraScroll), mScrollDuration);
27332733
post(this);
27342734
} else {

0 commit comments

Comments
 (0)