mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Android Tick Effect
This commit is contained in:
@@ -145,12 +145,11 @@ public class NativeMethods
|
|||||||
@SuppressWarnings(Const.JNI_METHOD_SUPPRESS)
|
@SuppressWarnings(Const.JNI_METHOD_SUPPRESS)
|
||||||
public static void hapticFeedback()
|
public static void hapticFeedback()
|
||||||
{
|
{
|
||||||
int duration_ms = 30;
|
|
||||||
final Context ctx = SDL.getContext();
|
final Context ctx = SDL.getContext();
|
||||||
if (Build.VERSION.SDK_INT >= 26) {
|
if (Build.VERSION.SDK_INT >= 26) {
|
||||||
((Vibrator) ctx.getSystemService(ctx.VIBRATOR_SERVICE)).vibrate(VibrationEffect.createOneShot(duration_ms, 5));
|
((Vibrator) ctx.getSystemService(ctx.VIBRATOR_SERVICE)).vibrate(VibrationEffect.createPredefined(VibrationEffect.EFFECT_TICK));
|
||||||
} else {
|
} else {
|
||||||
((Vibrator) ctx.getSystemService(ctx.VIBRATOR_SERVICE)).vibrate(duration_ms);
|
((Vibrator) ctx.getSystemService(ctx.VIBRATOR_SERVICE)).vibrate(30);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user