Harish
Harish

Reputation: 237

In Android TV how to Implement fixed size of Header like Youtube TV App

In my TV App, I need to implement the fixed Header in BrowseFragment like Youtube App. Below I have attached the screenshot how I want.

enter image description here

I'm implemented purely with Lean Back, my fragment is extended with browsefragment and I'm able to add icon and text to my header item.

Like below link they explained:

https://corochann.com/browsefragment-header-customization-android-tv-application-hands-on-tutorial-17-697.html

when focus moves to the right side, my header is collapsing fully. In my case, I want to collapse the header into little and need to show only icons in the header.

Upvotes: 7

Views: 2410

Answers (1)

Arpit J.
Arpit J.

Reputation: 1148

This type of functionality is not supported in Leanback. And I too searched the solution for it everywhere but didn't find anything useful. So I ended up writing a Fragment that behaves like the sidebar navigation and works with RowsSupportFragment through an interface for exchanging KeyPad Events.

When in Expanded State -> Menu Icon & Menu Names are shown.

When in Collapsed State -> Menu Icons are shown.

Navigation Collapsed state

Check out this Repository

Upvotes: 5

Related Questions