@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
Utils.DARK_THEME = Prefs.getBoolean("darktheme", false, this);
int theme;
String accent = Prefs.getString("accent_color", "pink_accent", this);
if (Utils.DARK_THEME) {
theme = sAccentDarkColors.get(accent);
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
} else {
theme = sAccentColors.get(accent);
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
}
setTheme(theme);
super.onCreate(savedInstanceState);
if (Prefs.getBoolean("forceenglish", false, this)) {
Utils.setLocale("en_US", this);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && setStatusBarColor()) {
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(statusBarColor());
}
}
BaseActivity.java 文件源码
java
阅读 37
收藏 0
点赞 0
评论 0
项目:KernelAdiutor-Mod
作者:
评论列表
文章目录