An in-depth look at the Leanback Library - Google I/O 2016

Android Developers · 12K views · 2016 · 39:49

Open on YouTube

Software (other)Consumer devices & gadgetstalkdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering Android TV and Leanback questions about customizing browse screens, title views, and presenters.

Recommended by 4 people across 4 different months, 2016 to 2019.

What it is

A Google I/O 2016 session from the Android Developers channel that walks through the components of the Android Leanback library for building Android TV apps. It covers the sample app, the main building blocks, and how to customize them to build a unique TV experience.

What people said

Recommends Kyle Venn · 2016-06 · Stack Overflow · on “Multiple ListRows for each Header on BrowseFragment - Leanback library”

The Leanback team has recently added in support for multiple ListRow s for one HeaderItem in version 24.0.0 of the library. It allows you to supply a RowsFragment that maps to the HeaderItem . You can see an example of it in their Leanback showcase [LINK] . Specifically, here [LINK] is the file where they provide an example. There is a new PageRowFragmentFactory that you will need in your BrowseFragment which specifies which Fragments map to which HeaderItem s. Like so: @Override public Fragment createFragment(Object rowObj) { Row row = (Row)rowObj; mBackgroundManager.setDrawable(null); if (row.getHeaderItem().getId() == HEADER_ID_1) { return new SampleFragmentA(); } else if (row.getHeaderIt

Recommends Morrison Chang · 2016-12 · Stack Overflow · on “What is the best way to make an Android TV menu?”

I would think if you are doing pagination & dropdown menus you are doing something wrong or at least not geared toward a Leanback experience - and something not easily navigatable with a d-pad. Two resources to checkout: the Google IO video on the library: [this video] and Udacity Android TV course: [LINK]

Recommends gfunk · 2017-03 · Stack Overflow · on “How to implement more than 2 level navigation in com.android.support:leanback-v17”

FYI - Leanback Updates Introduced After This SO Question Was Written & Answered: [LINK] and the tutorial video to go along with code: [this video]

Recommends burakk · 2019-08 · Stack Overflow · on “How to add pictures to the left menu of Android TV?”

You have to create your custom TitleView. Here [this video] is a great video on customizing the components of the leanback library (Custom TitleView part starts at 05:48) and here [LINK] is the source code of the CustomTitleView used in Google's Leanback Support Library Showcase App for Android TV

Cites gfunk · 2017-03 · Stack Overflow · on “Browse fragment customisation”

Use the PresenterSelector [LINK] Here is an example provided by Google: CardPresenterSelector.java [LINK] . The example is part of Leanback-Showcase [LINK] , if you download and run it you'll notice they don't actually do what you are specifically looking for - but I believe its setup to do so if you just made some edits in the CardPresenterSelector (linked above). (There's also a nice [this video] to go along with it)