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

State should be reset when dataset is invalidated or changed.

Open tjerkw opened this issue 13 years ago • 3 comments

@grivos found a problem when datasets are reloaded or invalidated:

However, There is a problem if the data set is changed and the current state is invalid. You might want to make WrapperListAdapterImpl extend BaseAdapter, and then in AbstractSlideExpandableListAdapter - override notifyDataSetChanged() and reset the state there.

(we found this ins issue #2, which is closed now)

tjerkw avatar Feb 01 '13 16:02 tjerkw

Wanted to solve it with:

registerDataSetObserver(new DataSetObserver() { ... } However If a user of the library would set its own datasetobserver it would break my listener. Since only one listener is allowed.

I think your (by grivos) solution is the correct one. It should also override notifyDataSetInvalidated() in that case.

Will look at this later.

tjerkw avatar Feb 01 '13 16:02 tjerkw

This also result in another unexpected behavior: If the listview is expanded and an expended item is removed the previous item gets expanded. A workaround is to collapse the listview before removing the item.

Giorgi avatar Mar 11 '13 20:03 Giorgi

Has there been any progress on this issue? My list rows have a button to delete the row, however when I remove a row from the underlying array adapter the state of the next row gets the state of the row that was deleted.

Nath5 avatar Jan 16 '14 00:01 Nath5