Optionaly go back to folder list

pull/194/merge
M66B 3 years ago
parent 3032b7fe4b
commit 5cabf7ed85

@ -1829,6 +1829,17 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
getSupportFragmentManager().popBackStack("messages", FragmentManager.POP_BACK_STACK_INCLUSIVE);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean foldernav = prefs.getBoolean("foldernav", false);
if (foldernav) {
long account = intent.getLongExtra("account", -1);
if (account > 0) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
getSupportFragmentManager().popBackStack("unified", 0);
onMenuFolders(account);
}
}
Bundle args = new Bundle();
args.putString("type", intent.getStringExtra("type"));
args.putLong("account", intent.getLongExtra("account", -1));

@ -69,6 +69,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
private SwitchCompat swQuickScroll;
private Button btnSwipes;
private SeekBar sbSwipeSensitivity;
private SwitchCompat swFolderNav;
private SwitchCompat swDoubleTap;
private SwitchCompat swSwipeNav;
private SwitchCompat swVolumeNav;
@ -100,7 +101,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
private final static String[] RESET_OPTIONS = new String[]{
"sync_on_launch", "double_back", "conversation_actions", "conversation_actions_replies", "language_detection",
"default_snooze",
"pull", "autoscroll", "quick_filter", "quick_scroll", "swipe_sensitivity",
"pull", "autoscroll", "quick_filter", "quick_scroll", "swipe_sensitivity", "foldernav",
"doubletap", "swipenav", "volumenav", "reversed", "swipe_close", "swipe_move",
"autoexpand", "expand_first", "expand_all", "expand_one", "collapse_multiple",
"autoclose", "onclose", "autoclose_unseen", "collapse_marked",
@ -131,6 +132,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swQuickScroll = view.findViewById(R.id.swQuickScroll);
btnSwipes = view.findViewById(R.id.btnSwipes);
sbSwipeSensitivity = view.findViewById(R.id.sbSwipeSensitivity);
swFolderNav = view.findViewById(R.id.swFolderNav);
swDoubleTap = view.findViewById(R.id.swDoubleTap);
swSwipeNav = view.findViewById(R.id.swSwipeNav);
swVolumeNav = view.findViewById(R.id.swVolumeNav);
@ -279,6 +281,13 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
}
});
swFolderNav.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("foldernav", checked).apply();
}
});
swDoubleTap.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -522,6 +531,8 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
int swipe_sensitivity = prefs.getInt("swipe_sensitivity", DEFAULT_SWIPE_SENSITIVITY);
sbSwipeSensitivity.setProgress(swipe_sensitivity);
swFolderNav.setChecked(prefs.getBoolean("foldernav", false));
swDoubleTap.setChecked(prefs.getBoolean("doubletap", true));
swSwipeNav.setChecked(prefs.getBoolean("swipenav", true));
swVolumeNav.setChecked(prefs.getBoolean("volumenav", false));

@ -294,6 +294,17 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSwipeSensitivity" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swFolderNav"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_folder_nav"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/sbSwipeSensitivity"
app:switchPadding="12dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>

@ -559,6 +559,7 @@
<string name="title_advanced_undo">Undo timeout</string>
<string name="title_advanced_quick_filter">Show non-obtrusive quick filter icons</string>
<string name="title_advanced_quick_scroll">Show non-obtrusive quick scroll up/down icons</string>
<string name="title_advanced_folder_nav">Always go back to the folder list from a message list</string>
<string name="title_advanced_autoread">Automatically mark messages read on moving messages</string>
<string name="title_advanced_star_snoozed">Automatically add star on snoozing messages</string>
<string name="title_advanced_autounstar">Automatically remove stars from messages on moving messages</string>

Loading…
Cancel
Save