mirror of https://github.com/M66B/FairEmail.git
Remember selected all-acounts swipe selection
This commit is contained in:
parent
300b6c58a2
commit
1ad80bfd05
|
@ -482,14 +482,23 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
||||||
|
|
||||||
adapter.addAll(folders);
|
adapter.addAll(folders);
|
||||||
|
|
||||||
spLeft.setSelection(2); // Trash
|
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||||
spRight.setSelection(1); // Archive
|
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())
|
return new AlertDialog.Builder(getContext())
|
||||||
.setView(dview)
|
.setView(dview)
|
||||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
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 left = (EntityFolder) spLeft.getSelectedItem();
|
||||||
EntityFolder right = (EntityFolder) spRight.getSelectedItem();
|
EntityFolder right = (EntityFolder) spRight.getSelectedItem();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue