File tree Expand file tree Collapse file tree
app/android/src/uk/co/lutraconsulting Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -290,19 +290,23 @@ public void vibrate()
290290 vib = vibManager .getDefaultVibrator ();
291291 }
292292
293+ // The reason why we use duplicate calls to vibrate is because some manufacturers (samsung) don't support
294+ // the usage of predefined VibrationEffect and vice versa. In the end only one vibration gets executed.
293295 if (Build .VERSION .SDK_INT < Build .VERSION_CODES .TIRAMISU )
294296 {
295297 if (Build .VERSION .SDK_INT < Build .VERSION_CODES .Q )
296298 {
297- vib .vibrate (VibrationEffect .createOneShot (10 , VibrationEffect .DEFAULT_AMPLITUDE ));
299+ vib .vibrate (VibrationEffect .createOneShot (100 , VibrationEffect .DEFAULT_AMPLITUDE ));
298300 } else
299301 {
300302 vib .vibrate (VibrationEffect .createPredefined (VibrationEffect .EFFECT_CLICK ));
303+ vib .vibrate (VibrationEffect .createOneShot (100 , VibrationEffect .DEFAULT_AMPLITUDE ));
301304 }
302305 } else
303306 {
304307 vib .vibrate (VibrationEffect .createPredefined (VibrationEffect .EFFECT_CLICK ),
305308 VibrationAttributes .createForUsage (VibrationAttributes .USAGE_CLASS_FEEDBACK ));
309+ vib .vibrate (VibrationEffect .createOneShot (100 , VibrationEffect .DEFAULT_AMPLITUDE ));
306310 }
307311 }
308312
You can’t perform that action at this time.
0 commit comments