• Nexus Player supports API level 21 or higher. • Leanback library is really useful. Almost essential. • Easy to work with if you don’t want to do something different. • Forget about touch your TV. Introduction
SearchFragment Override some methods to perform your search and indicate the adapter you are going to use to show search information. Your fragment has to implement Leanback SearchResultProvider interface.
Android Presenters Android Presenters are the base of how your data is shown inside Leanback Fragments. You can use some widgets from Leanback library or create your own presenters.
Recommendations Android gives you the opportunity to show content recommendations to your users. This mechanism is based on classic Android notifications.
Without Leanback library One of the problems related to the Leanback usage is that all your applications are going to be really similar. If you want to do something different, you’ll have to use your imagination. Some interesting ideas: • Use the focus and selectors to give more information to the user. • State list animator is going to be your new best friend. • Some elements will have to be focusables and disable the focus on runtime could be needed. • Change your backgrounds with cool images to provide more context to the user.
Without Leanback library: Focus NextFocusX configuration is going to be really useful for your UI. RequestFocus xml label will provide you more flexibility. Remember to enable focusable in some of your views, default state is false in some views.
Without Leanback library: State List Animators If you want to improve how your users know what’s the elemen it selected and you are not using a Leanback widget, you can use state list animators to animate your widgets when one get or lose the focus.
Without Leanback library: Use focus programmatically Use “getCurrentFocus()” method to know which is the view with the focus and don’ t be afraid to change “focusable” attribute of your views to create a better user experience.
Without Leanback library: Backgrounds To be able to provide more information to the user about the current context you can change the Activity/Fragment background.