Back to project page SimpleReader.
The source code is released under:
Apache License
If you think the Android project SimpleReader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.dreamteam.app.commons; /*from www .ja va 2s .c o m*/ import com.dreateam.app.ui.R; import android.content.Context; import android.content.SharedPreferences; public class SkinManager { public static final String SP_SKIN = "SP_SKIN"; public static final String SP_SKIN_TYPE_IS_NIGHT = "SP_SKIN_TYPE_IS_NIGHT"; private Context context; private SharedPreferences sp; private int skinType; private static int[] skinRes = {R.style.AppTheme, R.style.AppNightTheme}; public SkinManager(Context _context) { this.context = _context; this.sp = context.getSharedPreferences(SP_SKIN, Context.MODE_PRIVATE); this.skinType = sp.getBoolean(SP_SKIN_TYPE_IS_NIGHT, false) ? 1 : 0; } public int getCurrentSkinRes() { return skinRes[skinType]; } public static int getDaySkinRes() { return skinRes[0]; } public static int getNightSkinRes() { return skinRes[1]; } /////////////////////////////////////////////////// // getters and setters /////////////////////////////////////////////////// public int getSkinType() { return skinType; } public void setSkinType(int skinType) { this.skinType = skinType; } }