diff --git a/dachlatten-datetime-android/src/main/kotlin/de/sipgate/dachlatten/datetime/VibratorExt.kt b/dachlatten-datetime-android/src/main/kotlin/de/sipgate/dachlatten/datetime/VibratorExt.kt new file mode 100644 index 0000000..e4bffb0 --- /dev/null +++ b/dachlatten-datetime-android/src/main/kotlin/de/sipgate/dachlatten/datetime/VibratorExt.kt @@ -0,0 +1,13 @@ +package de.sipgate.dachlatten.datetime + +import android.Manifest +import android.os.Vibrator +import androidx.annotation.RequiresPermission +import kotlin.time.Duration + +@Suppress("unused") +@RequiresPermission(Manifest.permission.VIBRATE) +fun Vibrator.vibrate(duration: Duration) { + @Suppress("DEPRECATION") + vibrate(duration.inWholeMilliseconds) +}