I am trying to build my first Amazon Fire TV app using Android Lean back library. I want to customise the BrowseFragment to look like the image shown below.
I tried setting a custom layout as below.
@Override public View onInflateTitleView(LayoutInflater inflater, ViewGroup parent,
Bundle savedInstanceState) {
View title = inflater.inflate(R.layout.custom_title_view, parent, false);
titleImageView = (AppCompatImageView) title.findViewById(R.id.title_content_thumbnail);
return title;
}
but the resulting layout is showing as shown below, with a transparent TitleView and the list rows are showing below that. Please suggest a better approach to make the UI looks similar to the first image. Couldn't find anything that could implement this.


So, I have solved this somehow. My
activity_main.xmllooks like this.In the
FrameLayoutI will load a fragment which extended fromBrowseFragment, so this gives me the necessary rows.And at the top, I am loading
MainTitleFragmentwhich is extended fromFragmentand the layout looks like below.And this worked for me. Hope this helps.