private void updateActionBarBG(){
SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
int def = themePrefs.getInt("themeColor", AndroidUtilities.defColor);
int hColor = themePrefs.getInt("profileHeaderColor", def);
actionBar.setBackgroundColor(hColor);
listView.setGlowColor(hColor);
topViewColor = hColor;
int val = themePrefs.getInt("profileHeaderGradient", 0);
if (val > 0) {
topViewColor = 0x00000000;
int gradColor = themePrefs.getInt("profileHeaderGradientColor", def);
GradientDrawable.Orientation go;
switch (val) {
case 2:
go = GradientDrawable.Orientation.LEFT_RIGHT;
break;
case 3:
go = GradientDrawable.Orientation.TL_BR;
break;
case 4:
go = GradientDrawable.Orientation.BL_TR;
break;
default:
go = GradientDrawable.Orientation.TOP_BOTTOM;
topViewColor = gradColor;
}
int[] colors = new int[]{hColor, gradColor};
GradientDrawable actionBarGradient = new GradientDrawable(go, colors);
actionBar.setBackgroundDrawable(actionBarGradient);
}
topView.setBackgroundColor(topViewColor);
}
ProfileActivity.java 文件源码
java
阅读 35
收藏 0
点赞 0
评论 0
项目:PlusGram
作者:
评论列表
文章目录