From 7e5e3745cf0103219a13071fbd488c3c01da85d9 Mon Sep 17 00:00:00 2001 From: Adam Powell <adamp@google.com> Date: Mon, 24 May 2010 15:13:41 -0700 Subject: Fix bug 2710825 - Prevent ExpandableListView from scrolling too far when expanding children. Change-Id: I21b37647c5ad16e4f57fdda433e3b3ee2c7c83ad --- core/java/android/widget/AbsListView.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/java') diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 48e7f79..fcfecb3 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -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 { -- cgit v1.1