语言

VibrationEffect.Composition.DelayTypeRelativeStartOffset 字段

定义

注意

This constant will be removed in the future version. Use Android.OS.VibrationEffectCompositionDelayType enum directly instead of this field.

延迟表示开始此基元之前的偏移量,相对于合成中上一个基元的开始时间。

[Android.Runtime.Register("DELAY_TYPE_RELATIVE_START_OFFSET", ApiSince=36)]
[System.Obsolete("This constant will be removed in the future version. Use Android.OS.VibrationEffectCompositionDelayType enum directly instead of this field.", true)]
public const Android.OS.VibrationEffectCompositionDelayType DelayTypeRelativeStartOffset = 1;
[<Android.Runtime.Register("DELAY_TYPE_RELATIVE_START_OFFSET", ApiSince=36)>]
[<System.Obsolete("This constant will be removed in the future version. Use Android.OS.VibrationEffectCompositionDelayType enum directly instead of this field.", true)>]
val mutable DelayTypeRelativeStartOffset : Android.OS.VibrationEffectCompositionDelayType

字段值

Value = 1
属性

注解

延迟表示开始此基元之前的偏移量,相对于合成中上一个基元的开始时间。

基元将在上一个基元启动后请求的固定时间开始,这与设备硬件上该基元的实际持续时间无关。 这样就可以在合成中精确计时基元,确保按所需的间隔播放基元。 以下是示例:

VibrationEffect.startComposition()
                    .addPrimitive(PRIMITIVE_CLICK, 1.0)
                    .addPrimitive(PRIMITIVE_TICK, 1.0, 20, DELAY_TYPE_RELATIVE_START_OFFSET)
                    .addPrimitive(PRIMITIVE_THUD, 1.0, 80, DELAY_TYPE_RELATIVE_START_OFFSET)
                    .compose()

将在设备上执行如下操作:

0ms               20ms                     100ms
             PRIMITIVE_CLICK---PRIMITIVE_TICK-----------PRIMITIVE_THUD

如果基元与以前的基元重叠,则会从合成中删除。

Java文档android.os.VibrationEffect.Composition.DELAY_TYPE_RELATIVE_START_OFFSET。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于