mirror of https://github.com/M66B/FairEmail.git
Added option for up/down navigation button
This commit is contained in:
parent
6aa1bfea9d
commit
8f5bdc0176
|
@ -1345,6 +1345,14 @@ public class FragmentMessages extends FragmentBase
|
|||
}
|
||||
});
|
||||
|
||||
if (prefs.getBoolean("updown", false)) {
|
||||
boolean reversed = prefs.getBoolean("reversed", false);
|
||||
bottom_navigation.getMenu().findItem(R.id.action_prev)
|
||||
.setIcon(reversed ? R.drawable.baseline_arrow_upward_24 : R.drawable.baseline_arrow_downward_24);
|
||||
bottom_navigation.getMenu().findItem(R.id.action_next)
|
||||
.setIcon(reversed ? R.drawable.baseline_arrow_downward_24 : R.drawable.baseline_arrow_upward_24);
|
||||
}
|
||||
|
||||
bottom_navigation.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
|
||||
@Override
|
||||
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
|
||||
|
|
|
@ -154,7 +154,7 @@ public class FragmentOptions extends FragmentBase {
|
|||
"background_color", "text_color", "text_size", "text_font", "text_align", "text_titles", "text_separators",
|
||||
"collapse_quotes", "image_placeholders", "inline_images",
|
||||
"seekbar", "actionbar", "actionbar_swap", "actionbar_color", "group_category",
|
||||
"autoscroll", "swipenav", "reversed", "swipe_close", "swipe_move", "autoexpand", "autoclose", "onclose",
|
||||
"autoscroll", "swipenav", "updown", "reversed", "swipe_close", "swipe_move", "autoexpand", "autoclose", "onclose",
|
||||
"auto_hide_answer", "swipe_reply",
|
||||
"move_thread_all", "move_thread_sent",
|
||||
"language_detection",
|
||||
|
|
|
@ -74,6 +74,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
private SwitchCompat swDoubleTap;
|
||||
private SwitchCompat swSwipeNav;
|
||||
private SwitchCompat swVolumeNav;
|
||||
private SwitchCompat swUpDown;
|
||||
private SwitchCompat swReversed;
|
||||
private SwitchCompat swSwipeClose;
|
||||
private SwitchCompat swSwipeMove;
|
||||
|
@ -116,7 +117,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
"restore_on_launch", "sync_on_launch", "double_back", "conversation_actions", "conversation_actions_replies", "language_detection",
|
||||
"photo_picker", "default_snooze",
|
||||
"pull", "pull_all", "autoscroll", "quick_filter", "quick_scroll", "quick_actions", "swipe_sensitivity", "foldernav",
|
||||
"doubletap", "swipenav", "volumenav", "reversed", "swipe_close", "swipe_move",
|
||||
"doubletap", "swipenav", "volumenav", "updown", "reversed", "swipe_close", "swipe_move",
|
||||
"autoexpand", "expand_first", "expand_all", "expand_one", "collapse_multiple",
|
||||
"autoclose", "onclose", "autoclose_unseen", "autoclose_send", "collapse_marked",
|
||||
"undo_timeout",
|
||||
|
@ -157,6 +158,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
swDoubleTap = view.findViewById(R.id.swDoubleTap);
|
||||
swSwipeNav = view.findViewById(R.id.swSwipeNav);
|
||||
swVolumeNav = view.findViewById(R.id.swVolumeNav);
|
||||
swUpDown = view.findViewById(R.id.swUpDown);
|
||||
swReversed = view.findViewById(R.id.swReversed);
|
||||
swSwipeClose = view.findViewById(R.id.swSwipeClose);
|
||||
swSwipeMove = view.findViewById(R.id.swSwipeMove);
|
||||
|
@ -371,6 +373,13 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
}
|
||||
});
|
||||
|
||||
swUpDown.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("updown", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swReversed.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
|
@ -694,6 +703,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
swDoubleTap.setChecked(prefs.getBoolean("doubletap", false));
|
||||
swSwipeNav.setChecked(prefs.getBoolean("swipenav", true));
|
||||
swVolumeNav.setChecked(prefs.getBoolean("volumenav", false));
|
||||
swUpDown.setChecked(prefs.getBoolean("updown", false));
|
||||
swReversed.setChecked(prefs.getBoolean("reversed", false));
|
||||
swSwipeClose.setChecked(prefs.getBoolean("swipe_close", false));
|
||||
swSwipeMove.setChecked(prefs.getBoolean("swipe_move", false));
|
||||
|
|
|
@ -446,6 +446,17 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/swSwipeNav"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swUpDown"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/title_advanced_up_down"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swVolumeNav"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swReversed"
|
||||
android:layout_width="0dp"
|
||||
|
@ -455,7 +466,7 @@
|
|||
android:text="@string/title_advanced_reversed"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swVolumeNav"
|
||||
app:layout_constraintTop_toBottomOf="@id/swUpDown"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
|
|
|
@ -661,6 +661,7 @@
|
|||
<string name="title_advanced_double_tap">Double tap to mark message read/unread</string>
|
||||
<string name="title_advanced_swipenav">Swipe left/right to go to next/previous conversation</string>
|
||||
<string name="title_advanced_volumenav">Volume up/down to go to next/previous conversation</string>
|
||||
<string name="title_advanced_up_down">Use up/down arrows for next/previous conversation</string>
|
||||
<string name="title_advanced_reversed">Reverse navigation direction</string>
|
||||
<string name="title_advanced_swipe_close">Swipe down to close conversation</string>
|
||||
<string name="title_advanced_swipe_move">Swipe up to move conversation</string>
|
||||
|
|
Loading…
Reference in New Issue