A library for Android TV that extends the Leanback library capabilities by offering a set of more powerful features.
The Leanback library is astonishing in many different aspects, and Google has done an insanely good job at easing the developer's task of creating an awesome TV app. But Leanback comes with some limitations, and at some point, those limitations are just too big to be ignored.
These are some of the features that you get by using Sofa:
- Support for multiple rows per each category
- Support for custom fragments and manual focus handling
- Backwards compatible to standard implementation
- .. the same goes for BrowseSupportFragment!
Check the video below to see Sofa in action:
How to use
Simply migrate from
com.sgottard.sofa.BrowseFragment. That's it!
The best place to start is the demo project, more specifically the
To showcase a small example of one of the core features offered by Sofa, this is all it takes to
ArrayObjectAdapter with a
ListRowPresenter and fill it as you normally doSet the adapter to
ArrayObjectAdapter (no need for a
Presenter)Add a new
ListRow that contains the
RowsFragment instance and the corresponding
HeaderItemSet the adapter to
Pretty simple, uh? All the classes should be familiar to anyone that has used Leanback before, and so should be the use of those components.
I started populating the project's Wiki, in order to better explain what differences stand between the
BrowseFragment component offered by Sofa and its original counterpart, and how to make the best out of Sofa.