Create black theme

This commit is contained in:
Phillip Hsu
2016-09-27 03:24:58 -07:00
parent b9d6fdd0a7
commit 26215d3641
5 changed files with 29 additions and 3 deletions
@@ -41,12 +41,14 @@ public abstract class BaseActivity extends AppCompatActivity {
PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
// ========================================================================================
// TOneverDO: Set theme after setContentView()
// Since the default theme is light, we only need to check against the dark theme.
String themeDark = getString(R.string.theme_dark);
final String themeDark = getString(R.string.theme_dark);
final String themeBlack = getString(R.string.theme_black);
String theme = PreferenceManager.getDefaultSharedPreferences(this).getString(
getString(R.string.key_theme), null);
if (themeDark.equals(theme)) {
setTheme(R.style.AppTheme_Dark);
} else if (themeBlack.equals(theme)) {
setTheme(R.style.AppTheme_Black);
}
// ========================================================================================
setContentView(layoutResId());