mirror of
https://github.com/libretro/RetroArch
synced 2025-02-07 12:39:54 +00:00
Fix initialization of pattern and strengths arrays
Vibrator.vibrate(long[] pattern, int repeat) and VibrationEffect.createWaveform(long[] timings, int[] amplitudes, int repeat) expect an array of off/on pairs for both timings and amplitudes. Add an initial off time of zero to achieve expected vibration behavior.
This commit is contained in:
parent
4ca1692174
commit
a28ea1e1c6
@ -47,8 +47,8 @@ public class RetroActivityCommon extends NativeActivity
|
||||
{
|
||||
Vibrator vibrator = null;
|
||||
int repeat = 0;
|
||||
long[] pattern = {16};
|
||||
int[] strengths = {strength};
|
||||
long[] pattern = {0, 16};
|
||||
int[] strengths = {0, strength};
|
||||
|
||||
if (Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) {
|
||||
if (id == -1)
|
||||
@ -73,7 +73,7 @@ public class RetroActivityCommon extends NativeActivity
|
||||
if (oneShot > 0)
|
||||
repeat = -1;
|
||||
else
|
||||
pattern[0] = 1000;
|
||||
pattern[1] = 1000;
|
||||
|
||||
if (Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
if (id >= 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user