You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
View: basic implementation for performHapticFeedback
we currently ignore the feedbackConstant and simply vibrate for 10ms
This commit is contained in:
@@ -16,6 +16,7 @@ import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Looper;
|
||||
import android.os.Parcelable;
|
||||
import android.os.Vibrator;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.LayoutDirection;
|
||||
import android.util.Property;
|
||||
@@ -1060,7 +1061,9 @@ public class View extends Object {
|
||||
}
|
||||
|
||||
public boolean performHapticFeedback(int feedbackConstant, int flags) {
|
||||
Slog.v(TAG, "vibration motor go burrrr");
|
||||
// arbitrary; TODO: better mimic what AOSP does
|
||||
Vibrator vibrator = (Vibrator)getContext().getSystemService("vibrator");
|
||||
vibrator.vibrate(10);
|
||||
return true; // FIXME why is it not void
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user