In my Android TV app, I'm subclassing BrowseFragment
and adding rows of CardViews
using ArrayObjectAdapter
. The selection state of the cards is by default indicated by some kind of elevation effect, making the card bigger whenever it is selected. Is it possible to control the amount of elevation or resizing? I want the card to not zoom in more than a specific amount. I already tried to set elevation
, cardElevation
and cardMaxElevation
but with no effect. Does anyone know if the leanback library supports changing that behavior?
Asked
Active
Viewed 599 times
0

Micky
- 5,578
- 7
- 31
- 55
1 Answers
0
I haven't been able to use setElevation
effectively through CardViews
but I was able to change the max size of the select zoom effect when you construct the ListRowPresenter
. One of the parameters can be int focusZoomFactor
and depending on the number you put in the card will zoom in greater or smaller. More on this here.
final ListRowPresenter listRowPresenter = new ListRowPresenter(int focusZoomFactor);
You can also turn the shadow on or off by calling listRowPresenter.setShadowEnabled(boolean)
Still working on the elevation specifics though!

Rina
- 1
- 3