|
|
@ -87,6 +87,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|
|
|
private SwitchCompat swExpandAll;
|
|
|
|
private SwitchCompat swExpandAll;
|
|
|
|
private SwitchCompat swExpandOne;
|
|
|
|
private SwitchCompat swExpandOne;
|
|
|
|
private SwitchCompat swAutoClose;
|
|
|
|
private SwitchCompat swAutoClose;
|
|
|
|
|
|
|
|
private Spinner spSeenDelay;
|
|
|
|
private TextView tvAutoSeenHint;
|
|
|
|
private TextView tvAutoSeenHint;
|
|
|
|
private TextView tvOnClose;
|
|
|
|
private TextView tvOnClose;
|
|
|
|
private Spinner spOnClose;
|
|
|
|
private Spinner spOnClose;
|
|
|
@ -123,6 +124,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|
|
|
"pull", "pull_all", "autoscroll", "quick_filter", "quick_scroll", "quick_actions", "swipe_sensitivity", "foldernav",
|
|
|
|
"pull", "pull_all", "autoscroll", "quick_filter", "quick_scroll", "quick_actions", "swipe_sensitivity", "foldernav",
|
|
|
|
"doubletap", "swipenav", "volumenav", "updown", "reversed", "swipe_close", "swipe_move",
|
|
|
|
"doubletap", "swipenav", "volumenav", "updown", "reversed", "swipe_close", "swipe_move",
|
|
|
|
"autoexpand", "expand_first", "expand_all", "expand_one", "collapse_multiple",
|
|
|
|
"autoexpand", "expand_first", "expand_all", "expand_one", "collapse_multiple",
|
|
|
|
|
|
|
|
"seen_delay",
|
|
|
|
"autoclose", "onclose", "autoclose_unseen", "autoclose_send", "collapse_marked",
|
|
|
|
"autoclose", "onclose", "autoclose_unseen", "autoclose_send", "collapse_marked",
|
|
|
|
"undo_timeout",
|
|
|
|
"undo_timeout",
|
|
|
|
"autoread", "flag_snoozed", "autounflag", "auto_important", "reset_importance",
|
|
|
|
"autoread", "flag_snoozed", "autounflag", "auto_important", "reset_importance",
|
|
|
@ -171,6 +173,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|
|
|
swExpandAll = view.findViewById(R.id.swExpandAll);
|
|
|
|
swExpandAll = view.findViewById(R.id.swExpandAll);
|
|
|
|
swExpandOne = view.findViewById(R.id.swExpandOne);
|
|
|
|
swExpandOne = view.findViewById(R.id.swExpandOne);
|
|
|
|
swCollapseMultiple = view.findViewById(R.id.swCollapseMultiple);
|
|
|
|
swCollapseMultiple = view.findViewById(R.id.swCollapseMultiple);
|
|
|
|
|
|
|
|
spSeenDelay = view.findViewById(R.id.spSeenDelay);
|
|
|
|
tvAutoSeenHint = view.findViewById(R.id.tvAutoSeenHint);
|
|
|
|
tvAutoSeenHint = view.findViewById(R.id.tvAutoSeenHint);
|
|
|
|
swAutoClose = view.findViewById(R.id.swAutoClose);
|
|
|
|
swAutoClose = view.findViewById(R.id.swAutoClose);
|
|
|
|
tvOnClose = view.findViewById(R.id.tvOnClose);
|
|
|
|
tvOnClose = view.findViewById(R.id.tvOnClose);
|
|
|
@ -201,6 +204,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|
|
|
// Wire controls
|
|
|
|
// Wire controls
|
|
|
|
|
|
|
|
|
|
|
|
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
|
|
|
|
int[] undoValues = getResources().getIntArray(R.array.undoValues);
|
|
|
|
|
|
|
|
|
|
|
|
ibHelp.setOnClickListener(new View.OnClickListener() {
|
|
|
|
ibHelp.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -442,6 +446,19 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spSeenDelay.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
|
|
|
|
|
|
|
|
int value = undoValues[position];
|
|
|
|
|
|
|
|
prefs.edit().putInt("seen_delay", value).apply();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onNothingSelected(AdapterView<?> parent) {
|
|
|
|
|
|
|
|
prefs.edit().remove("seen_delay").apply();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
tvAutoSeenHint.setOnClickListener(new View.OnClickListener() {
|
|
|
|
tvAutoSeenHint.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
public void onClick(View v) {
|
|
|
@ -500,8 +517,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|
|
|
spUndoTimeout.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
|
spUndoTimeout.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
|
|
|
|
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
|
|
|
|
int[] values = getResources().getIntArray(R.array.undoValues);
|
|
|
|
int value = undoValues[position];
|
|
|
|
int value = values[position];
|
|
|
|
|
|
|
|
prefs.edit().putInt("undo_timeout", value).apply();
|
|
|
|
prefs.edit().putInt("undo_timeout", value).apply();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -680,6 +696,8 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|
|
|
if (view == null || getContext() == null)
|
|
|
|
if (view == null || getContext() == null)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int[] undoValues = getResources().getIntArray(R.array.undoValues);
|
|
|
|
|
|
|
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
|
|
|
|
|
|
|
|
swRestoreOnLaunch.setChecked(prefs.getBoolean("restore_on_launch", false));
|
|
|
|
swRestoreOnLaunch.setChecked(prefs.getBoolean("restore_on_launch", false));
|
|
|
@ -723,6 +741,13 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|
|
|
swExpandOne.setEnabled(!swExpandAll.isChecked());
|
|
|
|
swExpandOne.setEnabled(!swExpandAll.isChecked());
|
|
|
|
swCollapseMultiple.setChecked(prefs.getBoolean("collapse_multiple", true));
|
|
|
|
swCollapseMultiple.setChecked(prefs.getBoolean("collapse_multiple", true));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int seen_delay = prefs.getInt("seen_delay", 0);
|
|
|
|
|
|
|
|
for (int pos = 0; pos < undoValues.length; pos++)
|
|
|
|
|
|
|
|
if (undoValues[pos] == seen_delay) {
|
|
|
|
|
|
|
|
spSeenDelay.setSelection(pos);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
swAutoClose.setChecked(prefs.getBoolean("autoclose", true));
|
|
|
|
swAutoClose.setChecked(prefs.getBoolean("autoclose", true));
|
|
|
|
|
|
|
|
|
|
|
|
String onClose = prefs.getString("onclose", "");
|
|
|
|
String onClose = prefs.getString("onclose", "");
|
|
|
@ -741,7 +766,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|
|
|
swCollapseMarked.setChecked(prefs.getBoolean("collapse_marked", true));
|
|
|
|
swCollapseMarked.setChecked(prefs.getBoolean("collapse_marked", true));
|
|
|
|
|
|
|
|
|
|
|
|
int undo_timeout = prefs.getInt("undo_timeout", 5000);
|
|
|
|
int undo_timeout = prefs.getInt("undo_timeout", 5000);
|
|
|
|
int[] undoValues = getResources().getIntArray(R.array.undoValues);
|
|
|
|
|
|
|
|
for (int pos = 0; pos < undoValues.length; pos++)
|
|
|
|
for (int pos = 0; pos < undoValues.length; pos++)
|
|
|
|
if (undoValues[pos] == undo_timeout) {
|
|
|
|
if (undoValues[pos] == undo_timeout) {
|
|
|
|
spUndoTimeout.setSelection(pos);
|
|
|
|
spUndoTimeout.setSelection(pos);
|
|
|
|