Philip Giuliani Philip Giuliani - 1 year ago 127
Android Question

Disable row scaling / expand in BrowseFragment

I have not found any documentation how to disable the row scaling when switching the focus from the Headers to the Fragments in a BrowseFragment.

Leanback version 24.2.0

The BrowseFragment has a function

which solves the problem partially. The images now have the full size, but the titles are still not expanded like they are in the PlayStore App, Youtube app. The expand (without animation) when focusing a row.

What i did so far:

  • enableMainFragmentScaling(false);
    in BrowseFragment

  • setExpand(false);
    in the nested RowsFragments. But it didn't change anything.

The Code is very similar to the demo leanback project. But there they have row scaling enabled. Demo on Github

Answer Source

I was able to achieve this affect by calling setExpand(true) as the first line of my onCreateView() in my RowsFragment.

If you want to lock this effect forever, you can override setExpand(...) in your RowsFragment and just call super.setExpand(true). I believe you'll still need the initial call in onCreateView() though.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download