How do I get the title of the individual rows to always appear instead of only when it is selected? Like the example here in Youtube app, "Uploads" and "Popular Uploads" should always be seen.
Asked
Active
Viewed 588 times
1
-
When you build movie info add that title also. – Jay Rathod Sep 09 '16 at 12:03
1 Answers
0
I just answered this question here, but the general gist is:
I was able to achieve this affect by calling
setExpand(true)
as the first line of myonCreateView()
in myRowsFragment
.If you want to lock this effect forever, you can override
setExpand(...)
in yourRowsFragment
and just callsuper.setExpand(true)
. I believe you'll still need the initial call inonCreateView()
though.
-
Are you using a custom RowFragment for this? When I try to setExpand(true), getRowFragment returns null – Sammys Oct 05 '16 at 00:33
-
Yes, I'm using a custom RowsFragment. The class that those calls go into is your subclass of `RowsFragment`. If you're unfamiliar with leanback, you can check out [this example](https://github.com/googlesamples/leanback-showcase) and [this example](https://github.com/googlesamples/androidtv-Leanback) provided by the leanback team. – Kyle Venn Oct 05 '16 at 13:41