Commit 940e7dae authored by Adrien Maglo's avatar Adrien Maglo

Styles: add an ugly black theme.

Please change the drawables and colors.
parent 140a5787
......@@ -197,6 +197,8 @@
<string name="enable_jump_buttons_summary">Show backward and forward buttons on the video interface</string>
<string name="enable_steal_remote_control">Exclusive headset remote control</string>
<string name="enable_steal_remote_control_summary">Avoid conflicts by stealing the remote control from other apps. This prevents dialing on double click on HTC phones.</string>
<string name="enable_black_theme">Enable the black theme</string>
<string name="enable_black_theme_summary">Change the interface colors for a better comfort in low light environments.</string>
<string name="performance_prefs_category">Performance</string>
<string name="chroma_format">Force video chroma</string>
<string name="chroma_format_summary">RGB 32-bit: default chroma\nRGB 16-bit: better performance but lower quality\nYUV: best performance but does not work on all devices. Android 2.3 and later only.</string>
......
......@@ -39,6 +39,14 @@
<item name="android:windowBackground">@color/background_common</item>
</style>
<style name="Theme.VLC.Black" parent="Theme.VLC">
<item name="font_default">@color/white</item>
<item name="background_player">@color/font_default</item>
<item name="background_playlist">@color/font_default</item>
<item name="list_title">@color/bt_list_title</item>
<item name="android:windowBackground">@color/font_default</item>
</style>
<style name="Theme.VLC.List">
<item name="android:listSelector">@drawable/background_item</item>
</style>
......
......@@ -35,6 +35,11 @@
android:key="enable_steal_remote_control"
android:summary="@string/enable_steal_remote_control_summary"
android:title="@string/enable_steal_remote_control" />
<CheckBoxPreference
android:defaultValue="false"
android:key="enable_black_theme"
android:summary="@string/enable_black_theme_summary"
android:title="@string/enable_black_theme" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/performance_prefs_category" >
......
......@@ -186,6 +186,11 @@ public class MainActivity extends SherlockFragmentActivity {
mMenu = (SlidingMenu) LayoutInflater.from(this).inflate(R.layout.sliding_menu, null);
changeMenuOffset();
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
boolean enableBlackTheme = pref.getBoolean("enable_black_theme", false);
if (enableBlackTheme)
setTheme(R.style.Theme_VLC_Black);
View v_main = LayoutInflater.from(this).inflate(R.layout.main, null);
setContentView(v_main);
......@@ -660,6 +665,11 @@ public class MainActivity extends SherlockFragmentActivity {
if (requestCode == ACTIVITY_RESULT_PREFERENCES) {
if (resultCode == PreferencesActivity.RESULT_RESCAN)
MediaLibrary.getInstance(this).loadMediaItems(this, true);
else if (resultCode == PreferencesActivity.RESULT_RESTART) {
Intent intent = getIntent();
finish();
startActivity(intent);
}
}
}
......
......@@ -60,6 +60,7 @@ public class PreferencesActivity extends PreferenceActivity implements OnSharedP
public final static String VIDEO_RESUME_TIME = "VideoResumeTime";
public final static String VIDEO_SUBTITLE_FILES = "VideoSubtitleFiles";
public final static int RESULT_RESCAN = RESULT_FIRST_USER + 1;
public final static int RESULT_RESTART = RESULT_FIRST_USER + 2;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -116,6 +117,17 @@ public class PreferencesActivity extends PreferenceActivity implements OnSharedP
}
});
// Black theme
Preference checkboxBlackTheme = findPreference("enable_black_theme");
checkboxBlackTheme.setOnPreferenceClickListener(
new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
setResult(RESULT_RESTART);
return true;
}
});
// Clear search history
Preference clearHistoryPref = findPreference("clear_history");
clearHistoryPref.setOnPreferenceClickListener(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment