Stay organized with collections
Save and categorize content based on your preferences.
ParallelCombination
class ParallelCombination
A combination of haptic effects that should be played in multiple vibrators in parallel.
Summary
Public methods
addVibrator
fun addVibrator(
vibratorId: Int,
effect: VibrationEffect
): CombinedVibration.ParallelCombination
Add or replace a one shot vibration effect to be performed by the specified vibrator.
Parameters |
vibratorId |
Int: The id of the vibrator that should perform this effect. |
effect |
VibrationEffect: The effect this vibrator should play. This value cannot be null . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# CombinedVibration.ParallelCombination\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nParallelCombination\n===================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/os/CombinedVibration.ParallelCombination \"View this page in Java\") \n\n```\nclass ParallelCombination\n```\n\n|---|-------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.os.CombinedVibration.ParallelCombination](#) |\n\nA combination of haptic effects that should be played in multiple vibrators in parallel.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [CombinedVibration.ParallelCombination](#) | [addVibrator](#addVibrator(kotlin.Int,%20android.os.VibrationEffect))`(`vibratorId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `effect:` `[VibrationEffect](/reference/kotlin/android/os/VibrationEffect)`)` Add or replace a one shot vibration effect to be performed by the specified vibrator. |\n| [CombinedVibration](/reference/kotlin/android/os/CombinedVibration) | [combine](#combine())`()` Combine all of the added effects into a [CombinedVibration](/reference/kotlin/android/os/CombinedVibration). |\n\nPublic methods\n--------------\n\n### addVibrator\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun addVibrator(\n vibratorId: Int, \n effect: VibrationEffect\n): CombinedVibration.ParallelCombination\n```\n\nAdd or replace a one shot vibration effect to be performed by the specified vibrator.\n\n| Parameters ||\n|--------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| `vibratorId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The id of the vibrator that should perform this effect. |\n| `effect` | [VibrationEffect](/reference/kotlin/android/os/VibrationEffect): The effect this vibrator should play. This value cannot be `null`. |\n\n| Return ||\n|--------------------------------------------|------------------------------------------------------------------------------------------------------------------|\n| [CombinedVibration.ParallelCombination](#) | The [ParallelCombination](#) object to enable adding multiple effects in one chain. This value cannot be `null`. |\n\n**See Also**\n\n- [android.os.VibrationEffect#createOneShot(long, int)](/reference/kotlin/android/os/VibrationEffect#createOneShot(kotlin.Long,%20kotlin.Int)) \n\n### combine\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun combine(): CombinedVibration\n```\n\nCombine all of the added effects into a [CombinedVibration](/reference/kotlin/android/os/CombinedVibration). The [ParallelCombination](#) object is still valid after this call, so you can continue adding more effects to it and generating more [CombinedVibration](/reference/kotlin/android/os/CombinedVibration)s by calling this method again.\n\n| Return ||\n|---------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [CombinedVibration](/reference/kotlin/android/os/CombinedVibration) | The [CombinedVibration](/reference/kotlin/android/os/CombinedVibration) resulting from combining the added effects to be played in parallel. This value cannot be `null`. |"]]