konklone / congress-android

Congress for Android, an app for tracking Congress.
https://play.google.com/store/apps/details?id=com.sunlightlabs.android.congress
Other
157 stars 42 forks source link

Unify date presentation with a common list adapter #478

Closed konklone closed 12 years ago

konklone commented 12 years ago

It would take care of:

Defining a "Date" subitem, and require the subclass to define a method to map items to their date. It would take care of inserting the date wherever it changed. It would inflate the date view and insert the date into it. Subclasses could optionally override the dateformat or even the whole inflation.

Optionally accept an array of IDs to highlight, as long as the subclass has overridden the method to map an item to its ID. It would take the getView method that the subclass implements and insert it into a frame inside of a bigger view, with room for a highlight effect (depending on how the highlight effect should be implemented).

In future, we could implement the "sticky header" effect on dates, or whatever, all through this adapter.

This would seem to be applicable both to activities and fragments, and wouldn't require full fragmentization of Roll-, Bill-, and LegislatorList.

konklone commented 12 years ago

It doesn't make as sense as I thought to do this universally - really only on fields where you routinely expect many results to be under one day. I did this for floor updates and for bill activity, and can implement a sticky header on top of them if I want to.