[switch] change vibration
This commit is contained in:
@@ -561,8 +561,9 @@ public class Switch extends View {
|
||||
|
||||
private void vibrateChecked(boolean toCheck) {
|
||||
try {
|
||||
if (isHapticFeedbackEnabled() && android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) {
|
||||
final Vibrator vibrator = (Vibrator) getContext().getSystemService(Context.VIBRATOR_SERVICE);
|
||||
if (isHapticFeedbackEnabled() && android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
|
||||
/* final Vibrator vibrator = (Vibrator) getContext().getSystemService(Context.VIBRATOR_SERVICE);
|
||||
int slightAmplitude = OneUIUtilities.isOneUI() ? 5 : 15;
|
||||
VibrationEffect vibrationEffect = VibrationEffect.createWaveform(
|
||||
toCheck ? new long[] { 80, 25, 15 } : new long[] { 25, 80, 10 },
|
||||
@@ -570,7 +571,7 @@ public class Switch extends View {
|
||||
-1
|
||||
);
|
||||
vibrator.cancel();
|
||||
vibrator.vibrate(vibrationEffect);
|
||||
vibrator.vibrate(vibrationEffect); */
|
||||
semHaptics = true;
|
||||
}
|
||||
} catch (Exception ignore) {}
|
||||
|
||||
Reference in New Issue
Block a user