[Android] Hide search option for Amazon TVs

Geoffrey Métais git at videolan.org
Mon Jun 15 15:31:56 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jun 15 15:30:55 2015 +0200| [0cf9a05dc234139328476a6802c326ade71840cc] | committer: Geoffrey Métais

Hide search option for Amazon TVs

They are not compliant with Google service

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=0cf9a05dc234139328476a6802c326ade71840cc
---

 .../tv/src/org/videolan/vlc/gui/tv/MainTvActivity.java        |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/vlc-android/tv/src/org/videolan/vlc/gui/tv/MainTvActivity.java b/vlc-android/tv/src/org/videolan/vlc/gui/tv/MainTvActivity.java
index 0a64ed2..7755fcd 100644
--- a/vlc-android/tv/src/org/videolan/vlc/gui/tv/MainTvActivity.java
+++ b/vlc-android/tv/src/org/videolan/vlc/gui/tv/MainTvActivity.java
@@ -52,6 +52,7 @@ import android.graphics.drawable.Drawable;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
 import android.os.AsyncTask;
+import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
@@ -136,14 +137,16 @@ public class MainTvActivity extends Activity implements IVideoBrowser, OnItemVie
         mBrowseFragment.setHeadersState(BrowseFragment.HEADERS_ENABLED);
         mBrowseFragment.setTitle(getString(R.string.app_name));
         mBrowseFragment.setBadgeDrawable(getResources().getDrawable(R.drawable.icon));
-        // set search icon color
-        mBrowseFragment.setSearchAffordanceColor(getResources().getColor(R.color.orange500));
 
         // add a listener for selected items
         mBrowseFragment.setOnItemViewClickedListener(this);
         mBrowseFragment.setOnItemViewSelectedListener(this);
 
-        mBrowseFragment.setOnSearchClickedListener(this);
+        if (!Build.MANUFACTURER.equalsIgnoreCase("amazon")) { //Hide search for Amazon Fire TVs
+            mBrowseFragment.setOnSearchClickedListener(this);
+            // set search icon color
+            mBrowseFragment.setSearchAffordanceColor(getResources().getColor(R.color.orange500));
+        }
         mRootContainer = mBrowseFragment.getView();
         mMediaLibrary.loadMediaItems(true);
         BackgroundManager.getInstance(this).attach(getWindow());



More information about the Android mailing list