HapticIntensity
Pre-defined haptic intensity levels and custom intensity support
HapticIntensity
Module: jindong-core | Package: io.github.compose.jindong.core.model
Defines haptic vibration intensity with pre-defined levels and custom value support.
Definition
Pre-defined Levels
| Level | Value | Description |
|---|---|---|
LIGHT | 0.25 | Subtle feedback |
MEDIUM | 0.5 | Standard feedback (default) |
STRONG | 0.75 | Noticeable feedback |
HIGH | 1.0 | Maximum feedback |
Custom Intensity
Use Custom to specify any value between 0.0 and 1.0:
Values outside the range are automatically coerced:
- Values < 0.0 become 0.0
- Values > 1.0 become 1.0
Usage
Pre-defined Levels
Custom Values
Default Intensity
When not specified, MEDIUM is used:
Examples
Comparison Pattern
Fade Out
Fade In
Pulse Wave
Context-based Intensity
Properties
value
Returns the normalized intensity value (0.0 to 1.0).
Platform Behavior
| Platform | Interpretation |
|---|---|
| Android | Maps to VibrationEffect amplitude (0-255) |
| iOS | Maps to CHHapticEventParameter.intensity |
Notes
- Intensity affects vibration strength, not duration
- Some devices may not distinguish all levels
Customvalues are coerced to valid range- Default intensity is
MEDIUMwhen not specified