Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 939
Harish Avatar asked Jan 22 '19 12:01

Harish


People also ask

How do I run a mobile app on my TV?

Install APKs from an Android phone or tablet First, you'll need to install the "Send files to TV" app from the Play Store on both your phone and TV. To install it on your TV, open the Play Store and search for the name, or click the above link on a desktop computer and set your TV as the installation target.


1 Answers

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

like image 101
Arpit J. Avatar answered Oct 08 '22 08:10

Arpit J.