Skip to content Skip to sidebar Skip to footer

Is It Possible To Extend Abslistview To Make New Listview Implementations?

I've been looking at creating a stylistically different list view, like many other people, and I started by looking to extend AbsListView. Per the Android doc, AbsListView is: Bas

Solution 1:

The post is circa 2010, but his assessment still holds true today. Certain necessary methods & fields are protected, in order to prevent future incompatibilities that could result from changing the internals of AbsListView.

The best solution is still to copy the code for AbsListView into your project, along with necessary dependencies (the rabbit hole you mentioned).

In the meantime, if you want to describe what kind of View you're trying to build, we might be able to point you in a direction that's slightly easier than creating your own AbsListView?

Solution 2:

I've had the same experience trying to subclass ListView and AbsListView to develop a 2D scrollable spreadsheet. I ended up with my own subclass of ViewGroup which handles layout and a subclass of TwoDScrollView to handle the scrolling. The hardest parts are getting flings to work correctly (ie. create and place new views before they scroll into view) and synchronizing view positions between scrollable components. With enough time though, it is possible to create a robust component that pulls data from a Cursor and scrolls it around quite smoothly and quickly.

Post a Comment for "Is It Possible To Extend Abslistview To Make New Listview Implementations?"