Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove SearchOrbView Android TV

How can I remove the searchOrbView in the BrowseFragment of Android TV?

I see a way to set the colors (setSearchAffordanceColors), but no way to actually remove the SearchOrbView

Since the TitleView is a private member of BrowseFragment (and TitleView is the way to get to the SearchOrbView), I see no way of actually removing the SearchOrbView

like image 848
MobileMon Avatar asked Jul 13 '15 13:07

MobileMon


2 Answers

According to the official documentation, calling setOnSearchClickedListener() causes the search orb to be displayed in the title view.

Removing the method invocation will make the orb disappear.

like image 147
Sebastiano Avatar answered Oct 11 '22 02:10

Sebastiano


For those who doesnt read comments

you can simply achieve that defining a new style with Theme.Leanback.VerticalGrid as parent and setting item browseRowsMarginTop to any dp value you need. Then set this theme for the Activity implementing the vertical grid view. – fasteque

It helped me. style.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="@style/Theme.Leanback"></style>
<style name="NoTitleTheme" parent="@style/Theme.Leanback">
    <item name="browseRowsMarginTop">5dp</item>
</style>
</resources>

AndroidManifest.xml ....

<activity
    android:name=".stackedadprogram.StackedAdProgramActivity"
    android:exported="true"
    android:parentActivityName=".launcher.ProgramDetailActivity"
    android:theme="@style/NoTitleTheme" />
....
like image 22
Sely Lychee Avatar answered Oct 11 '22 01:10

Sely Lychee