tjerkw / Android-SlideExpandableListView

A better ExpandableListView, with animated expandable views for each list item
Apache License 2.0
1.98k stars 741 forks source link

How can i set the first item is expand by default? #71

Open liuzhitao2000 opened 10 years ago

liuzhitao2000 commented 10 years ago

How can i set the first item is expand by default?

JesseFarebro commented 10 years ago

With the current API there is no way to set an expanded item by default. The best you can do is expand the item manually or create a custom SaveState with an appropriate bitset and lastExpandedItem of 0.

On Thu, Apr 10, 2014 at 12:29 AM, akira notifications@github.com wrote:

How can i set the first item is expand by default?

Reply to this email directly or view it on GitHubhttps://github.com/tjerkw/Android-SlideExpandableListView/issues/71 .

SathishAndroid commented 10 years ago

Hi expand by default is possible. Just add this code from your AbstractSlideExpandableListAdapter.java

public AbstractSlideExpandableListAdapter(ListAdapter wrapped) { super(wrapped); lastOpenPosition = 0; openItems.set(lastOpenPosition, true); }

If you added this code, then your first item is expanded by default.

liuzhitao2000 commented 10 years ago

thanks @JesseFarebro @SathishAndroid :D