|
|
@ -73,6 +73,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|
|
|
private SwitchCompat swExpandOne;
|
|
|
|
private SwitchCompat swExpandOne;
|
|
|
|
private SwitchCompat swAutoClose;
|
|
|
|
private SwitchCompat swAutoClose;
|
|
|
|
private Spinner spOnClose;
|
|
|
|
private Spinner spOnClose;
|
|
|
|
|
|
|
|
private Spinner spUndoTimeout;
|
|
|
|
private SwitchCompat swCollapseMultiple;
|
|
|
|
private SwitchCompat swCollapseMultiple;
|
|
|
|
private SwitchCompat swAutoRead;
|
|
|
|
private SwitchCompat swAutoRead;
|
|
|
|
private SwitchCompat swFlagSnoozed;
|
|
|
|
private SwitchCompat swFlagSnoozed;
|
|
|
@ -87,7 +88,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|
|
|
"pull", "autoscroll", "quick_filter", "quick_scroll",
|
|
|
|
"pull", "autoscroll", "quick_filter", "quick_scroll",
|
|
|
|
"doubletap", "swipenav", "volumenav", "reversed",
|
|
|
|
"doubletap", "swipenav", "volumenav", "reversed",
|
|
|
|
"autoexpand", "expand_all", "expand_one", "collapse_multiple",
|
|
|
|
"autoexpand", "expand_all", "expand_one", "collapse_multiple",
|
|
|
|
"autoclose", "onclose",
|
|
|
|
"autoclose", "onclose", "undo_timeout",
|
|
|
|
"autoread", "flag_snoozed", "autounflag", "auto_important", "reset_importance"
|
|
|
|
"autoread", "flag_snoozed", "autounflag", "auto_important", "reset_importance"
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -121,6 +122,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|
|
|
swCollapseMultiple = view.findViewById(R.id.swCollapseMultiple);
|
|
|
|
swCollapseMultiple = view.findViewById(R.id.swCollapseMultiple);
|
|
|
|
swAutoClose = view.findViewById(R.id.swAutoClose);
|
|
|
|
swAutoClose = view.findViewById(R.id.swAutoClose);
|
|
|
|
spOnClose = view.findViewById(R.id.spOnClose);
|
|
|
|
spOnClose = view.findViewById(R.id.spOnClose);
|
|
|
|
|
|
|
|
spUndoTimeout = view.findViewById(R.id.spUndoTimeout);
|
|
|
|
swAutoRead = view.findViewById(R.id.swAutoRead);
|
|
|
|
swAutoRead = view.findViewById(R.id.swAutoRead);
|
|
|
|
swFlagSnoozed = view.findViewById(R.id.swFlagSnoozed);
|
|
|
|
swFlagSnoozed = view.findViewById(R.id.swFlagSnoozed);
|
|
|
|
swAutoUnflag = view.findViewById(R.id.swAutoUnflag);
|
|
|
|
swAutoUnflag = view.findViewById(R.id.swAutoUnflag);
|
|
|
@ -307,6 +309,20 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spUndoTimeout.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
|
|
|
|
|
|
|
|
int[] values = getResources().getIntArray(R.array.undoValues);
|
|
|
|
|
|
|
|
int value = values[position];
|
|
|
|
|
|
|
|
prefs.edit().putInt("undo_timeout", value).apply();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onNothingSelected(AdapterView<?> parent) {
|
|
|
|
|
|
|
|
prefs.edit().remove("undo_timeout").apply();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
swAutoRead.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
swAutoRead.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
@ -430,6 +446,14 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|
|
|
|
|
|
|
|
|
|
|
spOnClose.setEnabled(!swAutoClose.isChecked());
|
|
|
|
spOnClose.setEnabled(!swAutoClose.isChecked());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int undo_timeout = prefs.getInt("undo_timeout", 5000);
|
|
|
|
|
|
|
|
int[] undoValues = getResources().getIntArray(R.array.undoValues);
|
|
|
|
|
|
|
|
for (int pos = 0; pos < undoValues.length; pos++)
|
|
|
|
|
|
|
|
if (undoValues[pos] == undo_timeout) {
|
|
|
|
|
|
|
|
spUndoTimeout.setSelection(pos);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
swAutoRead.setChecked(prefs.getBoolean("autoread", false));
|
|
|
|
swAutoRead.setChecked(prefs.getBoolean("autoread", false));
|
|
|
|
swFlagSnoozed.setChecked(prefs.getBoolean("flag_snoozed", false));
|
|
|
|
swFlagSnoozed.setChecked(prefs.getBoolean("flag_snoozed", false));
|
|
|
|
swAutoUnflag.setChecked(prefs.getBoolean("autounflag", false));
|
|
|
|
swAutoUnflag.setChecked(prefs.getBoolean("autounflag", false));
|
|
|
|