|
|
|
@ -41,7 +41,8 @@ import androidx.preference.PreferenceManager;
|
|
|
|
|
|
|
|
|
|
public class FragmentOptionsSend extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
|
|
|
|
|
private SwitchCompat swKeyboard;
|
|
|
|
|
private SwitchCompat swSuggestLocal;
|
|
|
|
|
private SwitchCompat swSuggestSent;
|
|
|
|
|
private SwitchCompat swSuggestReceived;
|
|
|
|
|
private SwitchCompat swPrefixOnce;
|
|
|
|
|
private SwitchCompat swPlainOnly;
|
|
|
|
|
private SwitchCompat swUsenetSignature;
|
|
|
|
@ -52,7 +53,8 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
|
|
|
|
|
private Spinner spSendDelayed;
|
|
|
|
|
|
|
|
|
|
private final static String[] RESET_OPTIONS = new String[]{
|
|
|
|
|
"keyboard", "suggest_local", "prefix_once", "plain_only", "usenet_signature", "autoresize", "resize", "lookup_mx", "send_delayed"
|
|
|
|
|
"keyboard", "suggest_sent", "suggested_received", "prefix_once", "plain_only", "usenet_signature",
|
|
|
|
|
"autoresize", "resize", "lookup_mx", "send_delayed"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -66,7 +68,8 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
|
|
|
|
|
// Get controls
|
|
|
|
|
|
|
|
|
|
swKeyboard = view.findViewById(R.id.swKeyboard);
|
|
|
|
|
swSuggestLocal = view.findViewById(R.id.swSuggestLocal);
|
|
|
|
|
swSuggestSent = view.findViewById(R.id.swSuggestSent);
|
|
|
|
|
swSuggestReceived = view.findViewById(R.id.swSuggestReceived);
|
|
|
|
|
swPrefixOnce = view.findViewById(R.id.swPrefixOnce);
|
|
|
|
|
swPlainOnly = view.findViewById(R.id.swPlainOnly);
|
|
|
|
|
swUsenetSignature = view.findViewById(R.id.swUsenetSignature);
|
|
|
|
@ -89,10 +92,17 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
swSuggestLocal.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
|
swSuggestSent.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
|
|
prefs.edit().putBoolean("suggest_local", checked).apply();
|
|
|
|
|
prefs.edit().putBoolean("suggest_sent", checked).apply();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
swSuggestReceived.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
|
|
prefs.edit().putBoolean("suggest_received", checked).apply();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -206,7 +216,8 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
|
|
|
|
|
|
swKeyboard.setChecked(prefs.getBoolean("keyboard", true));
|
|
|
|
|
swSuggestLocal.setChecked(prefs.getBoolean("suggest_local", false));
|
|
|
|
|
swSuggestSent.setChecked(prefs.getBoolean("suggest_sent", false));
|
|
|
|
|
swSuggestReceived.setChecked(prefs.getBoolean("suggest_received", false));
|
|
|
|
|
swPrefixOnce.setChecked(prefs.getBoolean("prefix_once", true));
|
|
|
|
|
swPlainOnly.setChecked(prefs.getBoolean("plain_only", false));
|
|
|
|
|
swUsenetSignature.setChecked(prefs.getBoolean("usenet_signature", false));
|
|
|
|
|