Android-SlideExpandableListView icon indicating copy to clipboard operation
Android-SlideExpandableListView copied to clipboard

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

Open liuzhitao2000 opened this issue 11 years ago • 3 comments

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

liuzhitao2000 avatar Apr 10 '14 06:04 liuzhitao2000

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 [email protected] 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 .

JesseFarebro avatar Apr 10 '14 06:04 JesseFarebro

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.

SathishAndroid avatar Apr 15 '14 15:04 SathishAndroid

thanks @JesseFarebro @SathishAndroid :D

liuzhitao2000 avatar Apr 18 '14 05:04 liuzhitao2000