For a better handling and overview in expandableLists I would like to
show only the childelements of the last selected group - the
previously expanded group should be automaticly collapsed. The
groupheader of the expanded group should be als aligned to the top of
the screen to show the user that he's in the right group and that he
can start to read the group childs from the beginning.
This worked well with the following code until now (android 1.5 - 2.1)
but with android 2.2 the selection seems to work after the collapse
method call:
private int currentHourPosition = -1;
private ExpandableListView expandableListView;
@Override
public void onGroupExpand(int groupPosition) {
super.onGroupExpand(groupPosition);
if(currentHourPosition != -1 && currentHourPosition !=
groupPosition){
expandableListView.collapseGroup(currentHourPosition);
}
currentHourPosition = groupPosition;
expandableListView.setSelectedGroup(groupPosition);
}
If a group is selected by touch and expanded it should collapse the
previously expanded group (if one exists). To align the groupheader to
the top of the screen the method "setSelectedGroup(groupPosition)" is
called.
Without collapsing a group (e.g. if you close the group manually
before you open another) the selection is done correctly, otherwise
the list entries of the expanded group are shown somewhere in the
middle and not at the top as expected.
Has someone a solution or workaround for this issue?
The new API method smoothScrollToPosition (API level 8) is also not
working in this case.
I mentioned this issue also here:
http://code.google.com/p/android/issues/detail?id=9177
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en