Add haptic effect (AND-150)
This commit is contained in:
parent
217884aaec
commit
e9dde114b7
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
||||||
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/>
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/>
|
||||||
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>
|
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>
|
||||||
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
|
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
|
||||||
|
|
|
@ -6,7 +6,10 @@ import android.animation.AnimatorSet;
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.graphics.RectF;
|
import android.graphics.RectF;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.VibrationEffect;
|
||||||
|
import android.os.Vibrator;
|
||||||
import android.view.HapticFeedbackConstants;
|
import android.view.HapticFeedbackConstants;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -346,6 +349,13 @@ public class ComposePollViewController{
|
||||||
pollOptions.remove(dpo);
|
pollOptions.remove(dpo);
|
||||||
pollOptionsView.removeView(view);
|
pollOptionsView.removeView(view);
|
||||||
addPollOptionBtn.setEnabled(pollOptions.size()<maxPollOptions);
|
addPollOptionBtn.setEnabled(pollOptions.size()<maxPollOptions);
|
||||||
|
if(Build.VERSION.SDK_INT>=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;
|
return;
|
||||||
}
|
}
|
||||||
ReorderableLinearLayout.OnDragListener.super.onDragEnd(view);
|
ReorderableLinearLayout.OnDragListener.super.onDragEnd(view);
|
||||||
|
|
Loading…
Reference in New Issue