Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add button to BrowseFragment

I am developing an Android TV app using Leanback support library. I need to display a button in the top right corner (below the badge) of BrowseFragment. (as on below image)

hep_img

Here is the layout code

<?xml version="1.0" encoding="utf-8"?>

<fragment xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main_browse_fragment"
    android:name="tv.bishan.com.videoapp.ui.ItemFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"
    tools:deviceIds="tv"
    tools:ignore="MergeRootFrame"/>

How can I achieve this? Unable to find any solution from Google.

like image 894
Bishan Avatar asked Jan 25 '26 11:01

Bishan


1 Answers

You can create custom TitleView and set it to the activity theme using the browseTitleViewLayout attribute.

like image 170
Wiktor Dolhalov Avatar answered Jan 28 '26 21:01

Wiktor Dolhalov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!