diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3013079..2fdfb71 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -10,7 +10,7 @@ - + = 26) { + if(duration == 0) + { + v.cancel(); //stop vibration if still running + Toast.makeText(this, "Vibration has been stopped", Toast.LENGTH_SHORT).show(); + return; + } + + Toast.makeText(this, "Ampl: " + amplitude + ", Dur: " + duration, Toast.LENGTH_SHORT).show(); + + v.vibrate(VibrationEffect.createOneShot(duration,amplitude)); + + + } else { + + if(duration == 0) + { + v.cancel(); //stop vibration if still running + + return; + } + + v.vibrate(duration); + } + } + @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults);