[Android] UI : Apply black theme to the browser settings view

Alexandre Perraud git at videolan.org
Mon Mar 16 16:57:12 CET 2015


vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Mon Mar 16 16:56:12 2015 +0100| [4bdd232b0f2a9f6c351836208484d429f9a674bd] | committer: Alexandre Perraud

UI : Apply black theme to the browser settings view

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

 vlc-android/AndroidManifest.xml                           |    2 +-
 vlc-android/res/layout/browser.xml                        |    3 ++-
 vlc-android/res/layout/browser_item.xml                   |    1 +
 vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java |   11 +++++++++++
 4 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/vlc-android/AndroidManifest.xml b/vlc-android/AndroidManifest.xml
index 0cd780e..5b060c4 100644
--- a/vlc-android/AndroidManifest.xml
+++ b/vlc-android/AndroidManifest.xml
@@ -68,7 +68,7 @@
         <activity
             android:name=".gui.BrowserActivity"
             android:label="@string/mediafiles"
-            android:theme="@style/Theme.VLC.NoTitleBar" />
+            android:theme="@style/Theme.VLC" />
 
         <activity android:name=".gui.DebugLogActivity"
                   android:launchMode="singleTop" />
diff --git a/vlc-android/res/layout/browser.xml b/vlc-android/res/layout/browser.xml
index 6cb9cf2..bb7625e 100644
--- a/vlc-android/res/layout/browser.xml
+++ b/vlc-android/res/layout/browser.xml
@@ -7,5 +7,6 @@
               android:layout_width="fill_parent"
               android:layout_height="fill_parent" 
               android:paddingBottom="@dimen/listview_bottom_padding"
-              android:clipToPadding="false" />
+              android:clipToPadding="false"
+              android:background="?attr/background_default"/>
 </LinearLayout>
\ No newline at end of file
diff --git a/vlc-android/res/layout/browser_item.xml b/vlc-android/res/layout/browser_item.xml
index a341a98..4ebf006 100644
--- a/vlc-android/res/layout/browser_item.xml
+++ b/vlc-android/res/layout/browser_item.xml
@@ -11,6 +11,7 @@
         android:id="@+id/browser_item_selected"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:button="@drawable/custom_checkbox_button"
         android:focusable="false" />
     <TextView
         android:id="@+id/browser_item_dir"
diff --git a/vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java b/vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java
index 3a163ef..f843334 100644
--- a/vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java
@@ -41,7 +41,9 @@ import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.content.SharedPreferences;
 import android.os.Bundle;
+import android.preference.PreferenceManager;
 import android.text.InputType;
 import android.view.ContextMenu;
 import android.view.ContextMenu.ContextMenuInfo;
@@ -78,6 +80,7 @@ public class BrowserActivity extends ListActivity {
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
+        applyTheme();
         super.onCreate(savedInstanceState);
         setContentView(R.layout.browser);
         mAdapter = new BrowserAdapter(this);
@@ -97,6 +100,14 @@ public class BrowserActivity extends ListActivity {
         registerForContextMenu(getListView());
     }
 
+    private void applyTheme() {
+        SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
+        boolean enableBlackTheme = pref.getBoolean("enable_black_theme", false);
+        if (enableBlackTheme) {
+            setTheme(R.style.Theme_VLC_Black);
+        }
+    }
+
     private void refreshRoots() {
         ArrayList<String> list = new ArrayList<String>();
         list.addAll(AndroidDevices.getStorageDirectories());



More information about the Android mailing list