Skip to content

Kotlin Multiplatform utility library for vibratešŸ“±!

Notifications You must be signed in to change notification settings

jmseb3/Kmp-Vibrate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Ā 

History

13 Commits
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 

Repository files navigation

KMP Vibrate

Kotlin Multiplatform utility library for vibratešŸ“±!

Maven Central Version

How to Install

In lib.versions.toml include this dependency version catalog

[versions]
vibrate = "1.0.0"

[libraries]
vibrate = { module = "io.github.jmseb3:vibrate", version.ref = "vibrate" }
commonMain.dependencies {
    implementation(libs.vibrate)
}

or In build.gradle of app module, include this dependency

commonMain.dependencies {
    implementation("io.github.jmseb3:vibrate:1.0.0")
}
How To Test sample?

Android

To run the application on android device/emulator:

  • open project in Android Studio and run imported android run configuration

iOS

To run the application on iPhone device/simulator:

  • Open iosApp/iosApp.xcproject in Xcode and run standard configuration

JS Browser

Run the browser application: ./gradlew :sample:composeApp:jsBrowserDevelopmentRun --continue

Wasm Browser

Run the browser application: ./gradlew :sample:composeApp:wasmJsBrowserDevelopmentRun --continue


How To Use Vibrate

use VibratorManager

one Time

use VibratorManager.vibrate(time:Long)

if time 3000 = 3 Second

Pattern

use VibratorManager.vibratePattern(timings:List<Long>)

if timings is [300,500,700,500]

0.3 delay > 0.5 vibrate > 0.7 delay > 0.5 vibrate

Stop

VibratorManager.stopVibrate()

In Kotlin/Js Or Kotlin/Wasm

This feature is supported by the Vibrate API.

For more detailed information, please refer to the official documentation:

Vibrate Api

About

Kotlin Multiplatform utility library for vibratešŸ“±!

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages