mirror of https://github.com/M66B/FairEmail.git
Added option to disabled swipe navigation
This commit is contained in:
parent
b39c9f0610
commit
5ae209fc8d
|
@ -402,6 +402,10 @@ public class FragmentMessages extends FragmentBase {
|
||||||
activity.setSwipeListener(new SwipeListener.ISwipeListener() {
|
activity.setSwipeListener(new SwipeListener.ISwipeListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onSwipeRight() {
|
public boolean onSwipeRight() {
|
||||||
|
boolean swipenav = prefs.getBoolean("swipenav", true);
|
||||||
|
if (!swipenav)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (previous != null)
|
if (previous != null)
|
||||||
navigate(previous, true);
|
navigate(previous, true);
|
||||||
return (previous != null);
|
return (previous != null);
|
||||||
|
@ -409,6 +413,10 @@ public class FragmentMessages extends FragmentBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onSwipeLeft() {
|
public boolean onSwipeLeft() {
|
||||||
|
boolean swipenav = prefs.getBoolean("swipenav", true);
|
||||||
|
if (!swipenav)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (next != null)
|
if (next != null)
|
||||||
navigate(next, false);
|
navigate(next, false);
|
||||||
return (next != null);
|
return (next != null);
|
||||||
|
|
|
@ -74,11 +74,12 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||||
private SwitchCompat swActionbar;
|
private SwitchCompat swActionbar;
|
||||||
|
|
||||||
private SwitchCompat swPull;
|
private SwitchCompat swPull;
|
||||||
|
private SwitchCompat swSwipeNav;
|
||||||
private SwitchCompat swAutoExpand;
|
private SwitchCompat swAutoExpand;
|
||||||
private SwitchCompat swAutoClose;
|
private SwitchCompat swAutoClose;
|
||||||
private SwitchCompat swAutoNext;
|
private SwitchCompat swAutoNext;
|
||||||
private SwitchCompat swAutoRead;
|
|
||||||
private SwitchCompat swCollapse;
|
private SwitchCompat swCollapse;
|
||||||
|
private SwitchCompat swAutoRead;
|
||||||
private SwitchCompat swAutoMove;
|
private SwitchCompat swAutoMove;
|
||||||
private SwitchCompat swSender;
|
private SwitchCompat swSender;
|
||||||
private SwitchCompat swAutoResize;
|
private SwitchCompat swAutoResize;
|
||||||
|
@ -101,7 +102,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||||
"enabled", "updates",
|
"enabled", "updates",
|
||||||
"metered", "download",
|
"metered", "download",
|
||||||
"unified", "date", "threading", "avatars", "identicons", "preview", "addresses", "autoimages", "actionbar",
|
"unified", "date", "threading", "avatars", "identicons", "preview", "addresses", "autoimages", "actionbar",
|
||||||
"pull", "autoexpand", "autoclose", "autonext", "autoread", "collapse", "automove", "sender", "autoresize", "autosend",
|
"pull", "swipenav", "autoexpand", "autoclose", "autonext", "collapse", "autoread", "automove", "sender", "autoresize", "autosend",
|
||||||
"light", "sound",
|
"light", "sound",
|
||||||
"debug",
|
"debug",
|
||||||
"first", "why", "last_update_check", "app_support", "message_swipe", "message_select", "folder_actions", "folder_sync",
|
"first", "why", "last_update_check", "app_support", "message_swipe", "message_select", "folder_actions", "folder_sync",
|
||||||
|
@ -136,11 +137,12 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||||
swActionbar = view.findViewById(R.id.swActionbar);
|
swActionbar = view.findViewById(R.id.swActionbar);
|
||||||
|
|
||||||
swPull = view.findViewById(R.id.swPull);
|
swPull = view.findViewById(R.id.swPull);
|
||||||
|
swSwipeNav = view.findViewById(R.id.swSwipeNav);
|
||||||
swAutoExpand = view.findViewById(R.id.swAutoExpand);
|
swAutoExpand = view.findViewById(R.id.swAutoExpand);
|
||||||
swAutoClose = view.findViewById(R.id.swAutoClose);
|
swAutoClose = view.findViewById(R.id.swAutoClose);
|
||||||
swAutoNext = view.findViewById(R.id.swAutoNext);
|
swAutoNext = view.findViewById(R.id.swAutoNext);
|
||||||
swAutoRead = view.findViewById(R.id.swAutoRead);
|
|
||||||
swCollapse = view.findViewById(R.id.swCollapse);
|
swCollapse = view.findViewById(R.id.swCollapse);
|
||||||
|
swAutoRead = view.findViewById(R.id.swAutoRead);
|
||||||
swAutoMove = view.findViewById(R.id.swAutoMove);
|
swAutoMove = view.findViewById(R.id.swAutoMove);
|
||||||
swSender = view.findViewById(R.id.swSender);
|
swSender = view.findViewById(R.id.swSender);
|
||||||
swAutoResize = view.findViewById(R.id.swAutoResize);
|
swAutoResize = view.findViewById(R.id.swAutoResize);
|
||||||
|
@ -292,7 +294,6 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
swPull.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
swPull.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||||
|
@ -300,6 +301,13 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
swSwipeNav.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||||
|
prefs.edit().putBoolean("swipenav", checked).apply();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
swAutoExpand.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
swAutoExpand.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||||
|
@ -322,13 +330,6 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
swAutoRead.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
||||||
prefs.edit().putBoolean("autoread", checked).apply();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
swCollapse.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
swCollapse.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||||
|
@ -336,6 +337,13 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
swAutoRead.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||||
|
prefs.edit().putBoolean("autoread", checked).apply();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
swAutoMove.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
swAutoMove.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||||
|
@ -480,12 +488,13 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||||
swActionbar.setChecked(prefs.getBoolean("actionbar", true));
|
swActionbar.setChecked(prefs.getBoolean("actionbar", true));
|
||||||
|
|
||||||
swPull.setChecked(prefs.getBoolean("pull", true));
|
swPull.setChecked(prefs.getBoolean("pull", true));
|
||||||
|
swSwipeNav.setChecked(prefs.getBoolean("swipenav", true));
|
||||||
swAutoExpand.setChecked(prefs.getBoolean("autoexpand", true));
|
swAutoExpand.setChecked(prefs.getBoolean("autoexpand", true));
|
||||||
swAutoClose.setChecked(prefs.getBoolean("autoclose", true));
|
swAutoClose.setChecked(prefs.getBoolean("autoclose", true));
|
||||||
swAutoNext.setChecked(prefs.getBoolean("autonext", false));
|
swAutoNext.setChecked(prefs.getBoolean("autonext", false));
|
||||||
swAutoNext.setEnabled(!swAutoClose.isChecked());
|
swAutoNext.setEnabled(!swAutoClose.isChecked());
|
||||||
swAutoRead.setChecked(prefs.getBoolean("autoread", false));
|
|
||||||
swCollapse.setChecked(prefs.getBoolean("collapse", false));
|
swCollapse.setChecked(prefs.getBoolean("collapse", false));
|
||||||
|
swAutoRead.setChecked(prefs.getBoolean("autoread", false));
|
||||||
swAutoMove.setChecked(!prefs.getBoolean("automove", false));
|
swAutoMove.setChecked(!prefs.getBoolean("automove", false));
|
||||||
swSender.setChecked(prefs.getBoolean("sender", false));
|
swSender.setChecked(prefs.getBoolean("sender", false));
|
||||||
swAutoResize.setChecked(prefs.getBoolean("autoresize", true));
|
swAutoResize.setChecked(prefs.getBoolean("autoresize", true));
|
||||||
|
|
|
@ -399,6 +399,18 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/vSeparatorBehavior"
|
app:layout_constraintTop_toBottomOf="@id/vSeparatorBehavior"
|
||||||
app:switchPadding="12dp" />
|
app:switchPadding="12dp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.SwitchCompat
|
||||||
|
android:id="@+id/swSwipeNav"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:text="@string/title_advanced_swipenav"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/swPull"
|
||||||
|
app:switchPadding="12dp" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<androidx.appcompat.widget.SwitchCompat
|
||||||
android:id="@+id/swAutoExpand"
|
android:id="@+id/swAutoExpand"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -408,7 +420,7 @@
|
||||||
android:layout_marginEnd="12dp"
|
android:layout_marginEnd="12dp"
|
||||||
android:text="@string/title_advanced_autoexpand"
|
android:text="@string/title_advanced_autoexpand"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/swPull"
|
app:layout_constraintTop_toBottomOf="@id/swSwipeNav"
|
||||||
app:switchPadding="12dp" />
|
app:switchPadding="12dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -461,18 +473,6 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvAutoCloseHint"
|
app:layout_constraintTop_toBottomOf="@id/tvAutoCloseHint"
|
||||||
app:switchPadding="12dp" />
|
app:switchPadding="12dp" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
|
||||||
android:id="@+id/swAutoRead"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="12dp"
|
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
android:layout_marginEnd="12dp"
|
|
||||||
android:text="@string/title_advanced_autoread"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/swAutoNext"
|
|
||||||
app:switchPadding="12dp" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<androidx.appcompat.widget.SwitchCompat
|
||||||
android:id="@+id/swCollapse"
|
android:id="@+id/swCollapse"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -482,7 +482,19 @@
|
||||||
android:layout_marginEnd="12dp"
|
android:layout_marginEnd="12dp"
|
||||||
android:text="@string/title_advanced_collapse"
|
android:text="@string/title_advanced_collapse"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/swAutoRead"
|
app:layout_constraintTop_toBottomOf="@id/swAutoNext"
|
||||||
|
app:switchPadding="12dp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.SwitchCompat
|
||||||
|
android:id="@+id/swAutoRead"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:text="@string/title_advanced_autoread"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/swCollapse"
|
||||||
app:switchPadding="12dp" />
|
app:switchPadding="12dp" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<androidx.appcompat.widget.SwitchCompat
|
||||||
|
@ -494,7 +506,7 @@
|
||||||
android:layout_marginEnd="12dp"
|
android:layout_marginEnd="12dp"
|
||||||
android:text="@string/title_advanced_automove"
|
android:text="@string/title_advanced_automove"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/swCollapse"
|
app:layout_constraintTop_toBottomOf="@id/swAutoRead"
|
||||||
app:switchPadding="12dp" />
|
app:switchPadding="12dp" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<androidx.appcompat.widget.SwitchCompat
|
||||||
|
|
|
@ -161,6 +161,7 @@
|
||||||
<string name="title_advanced_pull_refresh">Pull down to refresh</string>
|
<string name="title_advanced_pull_refresh">Pull down to refresh</string>
|
||||||
<string name="title_advanced_autoexpand">Automatically expand messages</string>
|
<string name="title_advanced_autoexpand">Automatically expand messages</string>
|
||||||
<string name="title_advanced_autoclose">Automatically close conversations</string>
|
<string name="title_advanced_autoclose">Automatically close conversations</string>
|
||||||
|
<string name="title_advanced_swipenav">Swipe left/right to go to next/previous conversation</string>
|
||||||
<string name="title_advanced_autonext">Automatically go to next conversation on close conversation</string>
|
<string name="title_advanced_autonext">Automatically go to next conversation on close conversation</string>
|
||||||
<string name="title_advanced_autoread">Automatically mark messages read on moving messages</string>
|
<string name="title_advanced_autoread">Automatically mark messages read on moving messages</string>
|
||||||
<string name="title_advanced_collapse">Collapse messages in conversations on \'back\'</string>
|
<string name="title_advanced_collapse">Collapse messages in conversations on \'back\'</string>
|
||||||
|
|
Loading…
Reference in New Issue