[Android] Apply black theme for secondary activity

Geoffrey Métais git at videolan.org
Wed Mar 18 11:30:47 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Mar 18 11:30:04 2015 +0100| [c2eb21d86cad69f3740aace25938e8d51c8ead29] | committer: Geoffrey Métais

Apply black theme for secondary activity

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

 vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.java |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.java b/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.java
index d14ef6e..62970e5 100644
--- a/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.java
@@ -23,6 +23,7 @@
 package org.videolan.vlc.gui;
 
 import android.os.Bundle;
+import android.preference.PreferenceManager;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentTransaction;
 import android.support.v7.app.ActionBar;
@@ -50,6 +51,10 @@ public class SecondaryActivity  extends ActionBarActivity {
     Fragment mFragment;
     @Override
     protected void onCreate(Bundle savedInstanceState) {
+        /* Theme must be applied before super.onCreate */
+        if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("enable_black_theme", false)) {
+            setTheme(R.style.Theme_VLC_Black);
+        }
         super.onCreate(savedInstanceState);
         setContentView(R.layout.secondary);
 



More information about the Android mailing list