bauerca/drag-sort-listview — pull request #81 by scompt (2013-02-28 11:11:19+00:00)
Title: Make AdapterWrapper extend BaseAdapter

Enabling fast scrolling on a `DragSortListView` will result in an exception:

Reason: java.lang.ClassCastException: com.mobeta.android.dslv.DragSortListView$AdapterWrapper cannot be cast to android.widget.BaseAdapter

The `FastScroller` is expecting the list adapter to be an instance of `BaseAdapter`, which isn't the case because the `DragSortListView` wraps it in the inner `AdapterWrapper` class, which extends `HeaderViewListAdapter`, which itself isn't related to `BaseAdapter`. From what I can tell, this was only done because it handles some of the delegation to the wrapped class; the header/footer behavior that it also provides isn't used.

This pull request refactors `AdapterWrapper` to extends `BaseAdapter` by changing the class definition and delegating all of the necessary methods. It's loosely based on the [`AdapterWrapper`](https://github.com/commonsguy/cwac-adapter/blob/master/src/com/commonsware/cwac/adapter/AdapterWrapper.java) from @commonsguy. An alternative might be to include the `cwac-adapter` project as a dependency and extend from `AdapterWrapper`.