Fix bug 2710825 - Prevent ExpandableListView from scrolling too far when expanding children.
Change-Id: I21b37647c5ad16e4f57fdda433e3b3ee2c7c83ad
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user