Closed shawnlinboy closed 11 years ago
Use
collapseLastOpen(); // Returns true if an item was collapsed false otherwise
Before deleting the list item. You can as well check if any item is expanded by using
isAnyItemExpanded(); // Returns a boolean if there is any item expanded
If you want to make the transition a little more smooth post a delayed handler for the duration of the animation then remove the item as such:
if(collapseLastOpen()) {
new Handler().postDelayed(new Runnable() {
@Override public void run() {
removeMyListItem(position);
}, mAdapter.getAnimationDuration() );
} else {
removeMyListItem(position);
}
Also please look into the library a little more to figure out your solution next time. Hope this helps.
Got my problem solved. THX!
Hi, Thanks for creating this library.It works well with my app. I just added a button for deleting a listitem in the expandable view.However,as i clicked the button,the listitem can be deleted correctly, but the next listitem's expandable view will be expanded automaticlly,how to solve this problem?