Pages

Monday 1 December 2014

Paula Deen Network

Superfan TV logoSaffron Digital conceived Superfan TV as an OTT offering to allow fans to connect with celebrities more directly.

The business case was that it would enable the company to move up the value chain by developing content as well as delivering it.

The pilot project was the Paula Deen Network, and I worked on the Android app, which was built on their Vanilla platform.

Screen grab of the Paula Deen Network Recipe Details page
I developed the recipe details page. This lists the ingredients and steps to prepare a dish.

It consists of a single activity containing an ExpandableListView, which is forced to always display in its expanded state, which is a standard technique for displaying a list with titles.

This is split up as follows:

The top of the screen is an action bar. This consists of the PDN logo and other buttons.

The list header contains from the large photo of Paula, the title and other information, down to the “Cook Now” and “Favourites” buttons.

The list body contains the Ingredients, Preparation and Reviews sections.

The list footer contain the “You Might Also Like” and “Popular” sections. These were widgets that other team members had written, and I reused.

Note that each of the Ingredients, Preparation and Reviews sections has a different style. A default ExpandableListAdapter won’t do that, so I had to write a custom one.

The trick I used was that the custom adapter took a series of non-expandable ListAdapter objects to make up each group, which allowed each to be styled individually. And it also meant that it could have been reused elsewhere in the app or other projects.

The difficulty was that each view type has an index associated with it, and these are referenced from the expandable list view, so they had to have an offset applied to each to ensure that the views had a unique ID.

Using an adapter meant that the list could be composed of recyclable views, rather than creating them all when the screen was initialised. That would have inefficient since it uses more memory and performance takes a hit. Some of the other views were created this way initially, and subsequently rewritten.

There were a few other tweaks in the code to cope with the colour change half way down the list.