selfconference / selfconf-android

Android app for Self.conference
https://play.google.com/store/apps/details?id=org.selfconference.android
0 stars 0 forks source link

Refactor model objects #17

Closed macklinu closed 8 years ago

macklinu commented 8 years ago

This commit performs some major refactoring of the app’s models. A lot of repeated code was removed by code generation tools AutoValue and AutoValue-Parcel.

https://github.com/google/auto/tree/master/value https://github.com/rharter/auto-value-parcel

Now, models are abstract classes that basically define the models’ public APIs. Most models also have an inner abstract Builder class. Both are generated by AutoValue.

Model classes that need custom parceling behavior are annotated with @ParcelAdapter and a custom TypeAdapter parceling implementation. This allows AutoValue-Parcel to properly generate parceling code to maintain the Parcelable interface of our models.

To accommodate the updated model interfaces, Gson deserializers have been updated and/or created to properly deserialize JSON from the API into the proper models.

Resolves #3

macklinu commented 8 years ago

@crebma I'm assigning this to you. I know this is a large PR, but if you wouldn't mind either doing a quick QA or asking questions or just saying "do it up", that'd be cool, just so I'm not introducing a bunch of changes on the sly.

crebma commented 8 years ago

I will check it out tonight!

crebma commented 8 years ago

This looks really awesome!!