示例#1
0
 public void writeSettings(Settings settings) {
   FileOutputStream fos;
   try {
     fos = ctx.openFileOutput(SETTINGS_FILE_NAME, Context.MODE_PRIVATE);
     fos.write(settings.getFontSize());
     fos.write(settings.getBgColor());
     fos.close();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
示例#2
0
 private boolean refreshFontSizes() {
   final String fontSize = Settings.getFontSize(this);
   if ((mCurrentFontSize == null) || (!mCurrentFontSize.equals(fontSize))) {
     mCurrentFontSize = fontSize;
     if (fontSize.equals(getString(R.string.pref_fontsize_small))) {
       mFontSizeTitle = 15;
       mFontSizeDetails = 11;
     } else if (fontSize.equals(getString(R.string.pref_fontsize_normal))) {
       mFontSizeTitle = 18;
       mFontSizeDetails = 12;
     } else {
       mFontSizeTitle = 22;
       mFontSizeDetails = 15;
     }
     return true;
   } else {
     return false;
   }
 }