问题
I want to customize the FullWidthDetailsOverviewRowPresenter
in the Leanback DetailFragment
.
Three things I want to accomplish are:
- Getting the
Action
s from top to below of the overview. - Reducing the height of the overview so that it the related movies can be seen without scrolling down.
- The background image and the space it occupies at the top of the overview should be gone. The screen should start like the one above.
The end result should be like this:
I already know how to modify inside the overview. How should I modify outside of it?
回答1:
Because you are moving around the key views of this screen, it sounds like you might have to ditch the current implementation altogether and create your own custom view from scratch. By moving the buttons to the bottom and the detail image (seems like you're moving it to the right side of the description text), you're making it less and less justifiable to even subclass DetailFragment. The developers of Leanback were probably intentional about limiting customizing the interfaces too much as they want a consistent experience for different apps.
I would create a new layout file and load it up on your subclass of DetailsFragment (or DetailsPresenter), depending on your architecture.
You might find inspiration in this tuenti tv sample and part two of Marcus Gabilheri's customization series
回答2:
1) first create layout file named lb_fullwidth_details_overview.xml
and override the default view.
2) Put this into your dimens.xml <dimen name="lb_details_v2_card_height">350dp</dimen>
. It also overrides the default value defined in the library.
3) I am also searching the solution for it but as a hint I can suggest you to go through the styles and yes it can be obviously be done.
来源:https://stackoverflow.com/questions/47473310/leanback-detailfragment-fullwidthdetailsoverviewrowpresenter-customization