How to implement more than 2 level navigation in com.android.support:leanback-v17

若如初见. 提交于 2019-12-12 15:11:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!