Xplosive
Xplosive

Reputation: 681

Android TV: How to customize left navigation panel of android TV using Leanbak?

Currently I am working an android tv application project and my navigation panel is showing text and icon when it is in expanded mode like -

expanded

When navigation panel is collapsed it showing a vertical bar with just color and no icons or something is showing.

But I am trying to achieve this kind of design when navigation panel is collapsed -

collapsed

Now my question is is this achievable using leanback and if possible how can I implement it? Any kind of hints, tips or reference will be helpful. Thanks in advance.

Upvotes: 6

Views: 3713

Answers (3)

Fein Lam
Fein Lam

Reputation: 1

I think you can slide the view on the right side of the view to the left a part of the distance to cover the TextView in the NavigationBar on the left and only display the ICON.

Upvotes: 0

Abdul Muqeet
Abdul Muqeet

Reputation: 128

I think you can try Navigation Rail from Material Design. It is not a same thing but can get you somewhat close to your desire behavior or an alternative solution.

Here is link: https://m2.material.io/components/navigation-rail

Upvotes: 0

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.

check out this repository TVNavigationMenu

Navigation Closed

Upvotes: 2

Related Questions