[Android] Get rid of BackgroundManager

Geoffrey Métais git at videolan.org
Fri Jul 10 14:37:11 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jul 10 14:36:46 2015 +0200| [4a7cfe53fca59f20d4d97616204533fa1d11744b] | committer: Geoffrey Métais

Get rid of BackgroundManager

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

 vlc-android/tv/res/layout/tv_main_fragment.xml                    |    3 ++-
 vlc-android/tv/res/layout/tv_vertical_grid.xml                    |    3 ++-
 vlc-android/tv/src/org/videolan/vlc/gui/tv/MainTvActivity.java    |    4 ++--
 .../tv/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java    |    5 -----
 4 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/vlc-android/tv/res/layout/tv_main_fragment.xml b/vlc-android/tv/res/layout/tv_main_fragment.xml
index 2cf651b..dff43fa 100644
--- a/vlc-android/tv/res/layout/tv_main_fragment.xml
+++ b/vlc-android/tv/res/layout/tv_main_fragment.xml
@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="match_parent"
-        android:layout_height="match_parent">
+        android:layout_height="match_parent"
+        android:background="@color/material_blue_grey_800">
     <fragment
           android:name="android.support.v17.leanback.app.BrowseFragment"
           android:id="@+id/browse_fragment"
diff --git a/vlc-android/tv/res/layout/tv_vertical_grid.xml b/vlc-android/tv/res/layout/tv_vertical_grid.xml
index fe38259..3ae8d4a 100644
--- a/vlc-android/tv/res/layout/tv_vertical_grid.xml
+++ b/vlc-android/tv/res/layout/tv_vertical_grid.xml
@@ -1,6 +1,7 @@
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="match_parent"
-        android:layout_height="match_parent">
+        android:layout_height="match_parent"
+        android:background="@color/material_blue_grey_800">
     <FrameLayout
         android:id="@+id/tv_fragment_placeholder"
         android:layout_width="match_parent"
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 b559093..b3791bf 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
@@ -215,11 +215,11 @@ public class MainTvActivity extends BaseTvActivity implements IVideoBrowser, OnI
     }
 
     protected void updateBackground(Drawable drawable) {
-        mBackgroundManager.setDrawable(drawable);
+        BackgroundManager.getInstance(this).setDrawable(drawable);
     }
 
     protected void clearBackground() {
-        mBackgroundManager.setDrawable(mDefaultBackground);
+        BackgroundManager.getInstance(this).setDrawable(mDefaultBackground);
     }
 
     public void await() throws InterruptedException, BrokenBarrierException {
diff --git a/vlc-android/tv/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java b/vlc-android/tv/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java
index 0cf5402..2215fe5 100644
--- a/vlc-android/tv/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java
+++ b/vlc-android/tv/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java
@@ -44,19 +44,15 @@ import org.videolan.vlc.util.WeakHandler;
 
 public abstract class BaseTvActivity extends PlaybackServiceActivity {
     protected MediaLibrary mMediaLibrary;
-    protected BackgroundManager mBackgroundManager;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         mMediaLibrary = MediaLibrary.getInstance();
-        mBackgroundManager = BackgroundManager.getInstance(this);
-        mBackgroundManager.attach(getWindow());
     }
 
     @Override
     protected void onResume() {
-        mBackgroundManager.setColor(getResources().getColor(R.color.grey700));
         super.onResume();
         //Handle network connection state
         IntentFilter networkfilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
@@ -72,7 +68,6 @@ public abstract class BaseTvActivity extends PlaybackServiceActivity {
     @Override
     protected void onPause() {
         super.onPause();
-        mBackgroundManager.release();
         unregisterReceiver(mExternalDevicesReceiver);
     }
 



More information about the Android mailing list