Take headers into account when expanding a ExpListView group.

The possible scroll that happen after expanding a group did not take the possible
existing headers into account.

Change-Id: I5dc381baa7c54580e992e26a1ed55102afcb16b0
This commit is contained in:
Gilles Debunne
2010-03-01 10:54:51 -08:00
parent 5e747dd602
commit 52b65d39aa

View File

@@ -547,9 +547,10 @@ public class ExpandableListView extends ListView {
final int groupPos = posMetadata.position.groupPos;
final int groupFlatPos = posMetadata.position.flatListPos;
smoothScrollToPosition(groupFlatPos + mAdapter.getChildrenCount(groupPos),
groupFlatPos);
final int shiftedGroupPosition = groupFlatPos + getHeaderViewsCount();
smoothScrollToPosition(shiftedGroupPosition + mAdapter.getChildrenCount(groupPos),
shiftedGroupPosition);
}
returnValue = true;