|
|
@ -50,6 +50,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
|
|
|
|
private SwitchCompat swSendReminders;
|
|
|
|
private SwitchCompat swSendReminders;
|
|
|
|
private Spinner spSendDelayed;
|
|
|
|
private Spinner spSendDelayed;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Spinner spComposeFont;
|
|
|
|
private SwitchCompat swAutoList;
|
|
|
|
private SwitchCompat swAutoList;
|
|
|
|
private SwitchCompat swPrefixOnce;
|
|
|
|
private SwitchCompat swPrefixOnce;
|
|
|
|
private SwitchCompat swExtendedReply;
|
|
|
|
private SwitchCompat swExtendedReply;
|
|
|
@ -71,7 +72,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
|
|
|
|
private final static String[] RESET_OPTIONS = new String[]{
|
|
|
|
private final static String[] RESET_OPTIONS = new String[]{
|
|
|
|
"keyboard", "suggest_sent", "suggested_received", "suggest_frequently",
|
|
|
|
"keyboard", "suggest_sent", "suggested_received", "suggest_frequently",
|
|
|
|
"send_reminders", "send_delayed",
|
|
|
|
"send_reminders", "send_delayed",
|
|
|
|
"autolist", "prefix_once", "extended_reply", "quote_reply", "resize_reply",
|
|
|
|
"compose_font", "autolist", "prefix_once", "extended_reply", "quote_reply", "resize_reply",
|
|
|
|
"signature_location", "signature_reply", "signature_forward",
|
|
|
|
"signature_location", "signature_reply", "signature_forward",
|
|
|
|
"discard_delete",
|
|
|
|
"discard_delete",
|
|
|
|
"plain_only", "format_flowed", "usenet_signature", "remove_signatures",
|
|
|
|
"plain_only", "format_flowed", "usenet_signature", "remove_signatures",
|
|
|
@ -95,6 +96,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
|
|
|
|
btnLocalContacts = view.findViewById(R.id.btnLocalContacts);
|
|
|
|
btnLocalContacts = view.findViewById(R.id.btnLocalContacts);
|
|
|
|
swSendReminders = view.findViewById(R.id.swSendReminders);
|
|
|
|
swSendReminders = view.findViewById(R.id.swSendReminders);
|
|
|
|
spSendDelayed = view.findViewById(R.id.spSendDelayed);
|
|
|
|
spSendDelayed = view.findViewById(R.id.spSendDelayed);
|
|
|
|
|
|
|
|
spComposeFont = view.findViewById(R.id.spComposeFont);
|
|
|
|
|
|
|
|
|
|
|
|
swAutoList = view.findViewById(R.id.swAutoList);
|
|
|
|
swAutoList = view.findViewById(R.id.swAutoList);
|
|
|
|
swPrefixOnce = view.findViewById(R.id.swPrefixOnce);
|
|
|
|
swPrefixOnce = view.findViewById(R.id.swPrefixOnce);
|
|
|
@ -178,6 +180,24 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spComposeFont.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
|
|
|
|
|
|
|
|
String[] values = getResources().getStringArray(R.array.fontNameValues);
|
|
|
|
|
|
|
|
String value = values[position];
|
|
|
|
|
|
|
|
boolean monospaced = prefs.getBoolean("monospaced", false);
|
|
|
|
|
|
|
|
if (value.equals(monospaced ? "monospace" : "sans-serif"))
|
|
|
|
|
|
|
|
prefs.edit().remove("compose_font").apply();
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
prefs.edit().putString("compose_font", values[position]).apply();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onNothingSelected(AdapterView<?> parent) {
|
|
|
|
|
|
|
|
prefs.edit().remove("compose_font").apply();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
swAutoList.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
swAutoList.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
@ -361,6 +381,15 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean monospaced = prefs.getBoolean("monospaced", false);
|
|
|
|
|
|
|
|
String compose_font = prefs.getString("compose_font", monospaced ? "monospace" : "sans-serif");
|
|
|
|
|
|
|
|
String[] fontNameValues = getResources().getStringArray(R.array.fontNameValues);
|
|
|
|
|
|
|
|
for (int pos = 0; pos < fontNameValues.length; pos++)
|
|
|
|
|
|
|
|
if (fontNameValues[pos].equals(compose_font)) {
|
|
|
|
|
|
|
|
spComposeFont.setSelection(pos);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
swAutoList.setChecked(prefs.getBoolean("autolist", true));
|
|
|
|
swAutoList.setChecked(prefs.getBoolean("autolist", true));
|
|
|
|
swPrefixOnce.setChecked(prefs.getBoolean("prefix_once", true));
|
|
|
|
swPrefixOnce.setChecked(prefs.getBoolean("prefix_once", true));
|
|
|
|
swExtendedReply.setChecked(prefs.getBoolean("extended_reply", false));
|
|
|
|
swExtendedReply.setChecked(prefs.getBoolean("extended_reply", false));
|
|
|
|