diff --git a/mastodon/src/main/AndroidManifest.xml b/mastodon/src/main/AndroidManifest.xml index 5d24a64d..77799c15 100644 --- a/mastodon/src/main/AndroidManifest.xml +++ b/mastodon/src/main/AndroidManifest.xml @@ -4,6 +4,7 @@ + diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/viewcontrollers/ComposePollViewController.java b/mastodon/src/main/java/org/joinmastodon/android/ui/viewcontrollers/ComposePollViewController.java index ebd85907..c22a4ecc 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/viewcontrollers/ComposePollViewController.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/viewcontrollers/ComposePollViewController.java @@ -6,7 +6,10 @@ import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.app.AlertDialog; import android.graphics.RectF; +import android.os.Build; import android.os.Bundle; +import android.os.VibrationEffect; +import android.os.Vibrator; import android.view.HapticFeedbackConstants; import android.view.LayoutInflater; import android.view.View; @@ -346,6 +349,13 @@ public class ComposePollViewController{ pollOptions.remove(dpo); pollOptionsView.removeView(view); addPollOptionBtn.setEnabled(pollOptions.size()=Build.VERSION_CODES.R){ + Vibrator vibrator=fragment.getActivity().getSystemService(Vibrator.class); + if(vibrator.areAllPrimitivesSupported(VibrationEffect.Composition.PRIMITIVE_QUICK_RISE)){ + VibrationEffect effect=VibrationEffect.startComposition().addPrimitive(VibrationEffect.Composition.PRIMITIVE_QUICK_RISE).compose(); + vibrator.vibrate(effect); + } + } return; } ReorderableLinearLayout.OnDragListener.super.onDragEnd(view);