1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-21 05:37:07 +00:00

Changed default swipe sensitivity

This commit is contained in:
M66B 2021-07-27 14:38:08 +02:00
parent d98b4372c0
commit aaacabe593
3 changed files with 11 additions and 6 deletions

View file

@ -1984,13 +1984,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override
public float getSwipeEscapeVelocity(float defaultValue) {
int swipe_sensitivity = 10;
int swipe_sensitivity = FragmentOptionsBehavior.DEFAULT_SWIPE_SENSITIVITY;
Context context = getContext();
if (context != null) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
swipe_sensitivity = prefs.getInt("swipe_sensitivity", 10);
swipe_sensitivity = prefs.getInt("swipe_sensitivity", swipe_sensitivity);
}
return super.getSwipeEscapeVelocity(defaultValue) * (10 - swipe_sensitivity + 1);
return super.getSwipeEscapeVelocity(defaultValue) *
(FragmentOptionsBehavior.MAX_SWIPE_SENSITIVITY - swipe_sensitivity + 1);
}
@Override

View file

@ -91,6 +91,9 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
private SwitchCompat swAutoImportant;
private SwitchCompat swResetImportance;
final static int MAX_SWIPE_SENSITIVITY = 10;
final static int DEFAULT_SWIPE_SENSITIVITY = 7;
private final static String[] RESET_OPTIONS = new String[]{
"sync_on_launch", "double_back", "conversation_actions", "conversation_actions_replies", "language_detection",
"default_snooze",
@ -249,6 +252,8 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
}
});
sbSwipeSensitivity.setMax(MAX_SWIPE_SENSITIVITY);
sbSwipeSensitivity.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
@ -487,7 +492,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swQuickFilter.setChecked(prefs.getBoolean("quick_filter", false));
swQuickScroll.setChecked(prefs.getBoolean("quick_scroll", true));
int swipe_sensitivity = prefs.getInt("swipe_sensitivity", 10);
int swipe_sensitivity = prefs.getInt("swipe_sensitivity", DEFAULT_SWIPE_SENSITIVITY);
sbSwipeSensitivity.setProgress(swipe_sensitivity);
swDoubleTap.setChecked(prefs.getBoolean("doubletap", true));

View file

@ -289,8 +289,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:max="10"
android:min="1"
android:progress="10"
android:progress="7"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSwipeSensitivity" />