ShadowSystemVibrator
@Implements(android.os.Vibrator.class) public class ShadowVibrator extends Object
Modifier and Type | Field | Description |
---|---|---|
protected long[] |
pattern |
Constructor | Description |
---|---|
ShadowVibrator() |
Modifier and Type | Method | Description |
---|---|---|
int |
getEffectId() |
Returns the last vibration effect ID of a
VibrationEffect#Prebaked (e.g. |
long |
getMilliseconds() |
Returns the last vibration duration in MS.
|
long[] |
getPattern() |
Returns the last vibration pattern.
|
int |
getRepeat() |
Returns the last vibration repeat times.
|
boolean |
isCancelled() |
Returns true if the Vibrator has been cancelled.
|
boolean |
isVibrating() |
Returns true if the Vibrator is currently vibrating as controlled by
Vibrator.vibrate(long) |
void |
setHasAmplitudeControl(boolean hasAmplitudeControl) |
Controls the return value of
Vibrator.hasAmplitudeControl() the default is false. |
void |
setHasVibrator(boolean hasVibrator) |
Controls the return value of
Vibrator.hasVibrator() the default is true. |
public void setHasVibrator(boolean hasVibrator)
Vibrator.hasVibrator()
the default is true.public void setHasAmplitudeControl(boolean hasAmplitudeControl)
Vibrator.hasAmplitudeControl()
the default is false.public boolean isVibrating()
Vibrator.vibrate(long)
public boolean isCancelled()
public long getMilliseconds()
public long[] getPattern()
public int getEffectId()
VibrationEffect#Prebaked
(e.g. VibrationEffect#EFFECT_CLICK
).
This field is non-zero only if a VibrationEffect#Prebaked
was ever requested.
public int getRepeat()