コード例 #1
0
 private TextLayout textLayout() {
   String string = SettingsManager.sharedPreferences(this).getString(TextLayoutSetting.KEY, null);
   for (TextLayout textLayout : TextLayout.VALUES) {
     if (textLayout.toString().equals(string)) {
       return textLayout;
     }
   }
   return TextLayoutSetting.DEFAULT;
 }
コード例 #2
0
 private boolean onTextLayoutClick() {
   TextLayout textLayout =
       textLayout() instanceof LineWrapTextLayout ? TextLayout.WORD_WRAP : TextLayout.LINE_WRAP;
   sourceView.setTextLayout(textLayout);
   SharedPreferences.Editor editor = SettingsManager.sharedPreferences(TypeInActivity.this).edit();
   editor.putString(TextLayoutSetting.KEY, textLayout.toString());
   editor.commit();
   return true;
 }