diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 15e8d791c9..38f69329db 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -3303,11 +3303,13 @@ public class FragmentMessages extends FragmentBase if (expanded && swipe_reply) { redraw(viewHolder); + swipeFeedback(); onMenuReply(message, "reply", null, null); return; } if (EntityFolder.OUTBOX.equals(message.folderType)) { + swipeFeedback(); if (message.warning == null) ActivityCompose.undoSend(message.id, getContext(), getViewLifecycleOwner(), getParentFragmentManager()); else @@ -3350,6 +3352,8 @@ public class FragmentMessages extends FragmentBase " message=" + message.id + " folder=" + message.folderType); + swipeFeedback(); + if (EntityMessage.SWIPE_ACTION_ASK.equals(action)) { rvMessage.addOnChildAttachStateChangeListener(new RecyclerView.OnChildAttachStateChangeListener() { @Override @@ -3430,6 +3434,13 @@ public class FragmentMessages extends FragmentBase return message; } + private void swipeFeedback() { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); + boolean haptic_feedback_swipe = prefs.getBoolean("haptic_feedback_swipe", false); + if (haptic_feedback_swipe) + Helper.performHapticFeedback(view, HapticFeedbackConstants.GESTURE_END); + } + private void redraw(RecyclerView.ViewHolder vh) { if (vh != null) try { diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 3442e97e59..d53b3656e0 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -126,6 +126,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc private SeekBar sbClassMinDifference; private SwitchCompat swShowFiltered; private SwitchCompat swHapticFeedback; + private SwitchCompat swHapticFeedbackSwipe; private ImageButton ibClassification; private Spinner spLanguage; private SwitchCompat swUpdates; @@ -288,7 +289,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc final static List RESET_OPTIONS = Collections.unmodifiableList(Arrays.asList( "sort_answers", "shortcuts", "ical_tentative", "fts", "classification", "class_min_probability", "class_min_difference", - "show_filtered", "haptic_feedback", + "show_filtered", "haptic_feedback", "haptic_feedback_swipe", "language", "updates", "weekly", "beta", "show_changelog", "announcements", "crash_reports", "cleanup_attachments", @@ -395,6 +396,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc sbClassMinDifference = view.findViewById(R.id.sbClassMinDifference); swShowFiltered = view.findViewById(R.id.swShowFiltered); swHapticFeedback = view.findViewById(R.id.swHapticFeedback); + swHapticFeedbackSwipe = view.findViewById(R.id.swHapticFeedbackSwipe); spLanguage = view.findViewById(R.id.spLanguage); swUpdates = view.findViewById(R.id.swUpdates); tvGithubPrivacy = view.findViewById(R.id.tvGithubPrivacy); @@ -737,6 +739,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc } }); + swHapticFeedbackSwipe.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + prefs.edit().putBoolean("haptic_feedback_swipe", isChecked).apply(); + } + }); + spLanguage.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView adapterView, View view, int position, long id) { @@ -2473,6 +2482,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc swShowFiltered.setChecked(prefs.getBoolean("show_filtered", false)); swHapticFeedback.setChecked(prefs.getBoolean("haptic_feedback", true)); + swHapticFeedbackSwipe.setChecked(prefs.getBoolean("haptic_feedback_swipe", false)); int selected = -1; String language = prefs.getString("language", null); diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml index de49fb15d9..00ae94e143 100644 --- a/app/src/main/res/layout/fragment_options_misc.xml +++ b/app/src/main/res/layout/fragment_options_misc.xml @@ -344,6 +344,18 @@ app:layout_constraintTop_toBottomOf="@id/swShowFiltered" app:switchPadding="12dp" /> + + + app:layout_constraintTop_toBottomOf="@id/swHapticFeedbackSwipe" /> Minimum class difference: %1$s %% Show a filter icon when rules were applied Haptic feedback on important actions + Haptic feedback when swiping left/right Language System The cloud services below are not part of the app. Any payments will go directly to the cloud service and not to the app developer.