talk-android/app/src/main/java/com/nextcloud/talk/utils/VibrationUtils.kt
sowjanyakch f1d03e235a
ktlintFormat
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-11-21 11:34:24 +01:00

21 lines
584 B
Kotlin

/*
* Nextcloud Talk - Android Client
*
* SPDX-FileCopyrightText: 2023 Marcel Hibbe <dev@mhibbe.de>
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package com.nextcloud.talk.utils
import android.content.Context
import android.os.VibrationEffect
import android.os.Vibrator
object VibrationUtils {
const val SHORT_VIBRATE: Long = 100
fun vibrateShort(context: Context) {
val vibrator = context.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
vibrator.vibrate(VibrationEffect.createOneShot(SHORT_VIBRATE, VibrationEffect.DEFAULT_AMPLITUDE))
}
}