Skip to content

Commit

Permalink
Add Vibrator convenience wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
janseeger committed Dec 16, 2024
1 parent c4d4f18 commit 8e8b157
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit 8e8b157

Please sign in to comment.