Delay
DSL function to pause the pattern without vibrating
Delay
Module: jindong-compose | Package: io.github.compose.jindong.dsl
Pauses the pattern for the specified duration without vibrating.
Signature
Parameters
| Parameter | Type | Description |
|---|---|---|
duration | Duration | How long to wait before the next event |
Description
Delay adds a pause between haptic events. During the delay, no vibration occurs. This is useful for creating patterns with distinct gaps or rhythm.
Usage
Basic Usage
Creating Rhythm
Variable Delays
Timing Calculation
Delays affect the start time of subsequent events:
Examples
Heartbeat Pattern
SOS Pattern
Notification Pattern
Inside Repeat
Delays work naturally inside Repeat:
Notes
Delayadds to the pattern's total duration- Negative delays are not allowed. It will cause crash.
- Use delays to create distinct haptic "beats"
- Delays inside
Repeatare repeated with each iteration