1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-25 17:27:00 +00:00

Remember selected all-acounts swipe selection

This commit is contained in:
M66B 2020-04-01 13:30:33 +02:00
parent 300b6c58a2
commit 1ad80bfd05

View file

@ -482,14 +482,23 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
adapter.addAll(folders);
spLeft.setSelection(2); // Trash
spRight.setSelection(1); // Archive
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
int leftPos = prefs.getInt("swipe_left_default", 2); // Trash
int rightPos = prefs.getInt("swipe_right_default", 1); // Archive
spLeft.setSelection(leftPos);
spRight.setSelection(rightPos);
return new AlertDialog.Builder(getContext())
.setView(dview)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
prefs.edit()
.putInt("swipe_left_default", spLeft.getSelectedItemPosition())
.putInt("swipe_right_default", spRight.getSelectedItemPosition())
.apply();
EntityFolder left = (EntityFolder) spLeft.getSelectedItem();
EntityFolder right = (EntityFolder) spRight.getSelectedItem();