问题
In regular android application I can use navigation drawer for navigate between top level views (sections of app) What should be used in tv apps? I see only possibility for two level of content organizing Categories -> Movies But in our app we have several sections (Live channels, On demand Movies, Recorded shows etc) with categories in most of them. Is it possible using standard android.support.v17.leanback.app.BrowseFragment and android.support.v17.leanback.app.DetailsFragment?
回答1:
In short: no. BrowseFragment
and DetailsFragment
are meant to be a quick and easy way for developers to bring their content to TVs. They force you to that particular structure, which is pretty simple to understand and to navigate.
If you are willing to go all in for a custom experience, you will need to build your version of the BrowseFragment
, by using a HeadersFragment
and a RowsFragment
. This proves to be quite a headache, but I managed to do it for my company's application. If you're interested, I will write a post/article on this.
EDIT
Here's the article! It's part of a bigger collection called Building for Android TV, if you want to have a look.
来源:https://stackoverflow.com/questions/26166386/how-to-implement-more-than-2-level-navigation-in-com-android-supportleanback-v1