Change vibration duration to 50ms
This commit is contained in:
parent
4a88eadd50
commit
b534ccd756
|
@ -17,8 +17,6 @@ package org.xbmc.kore.utils;
|
|||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Vibrator;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.SoundEffectConstants;
|
||||
import android.view.View;
|
||||
|
@ -26,8 +24,6 @@ import android.view.animation.Animation;
|
|||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import org.xbmc.kore.Settings;
|
||||
|
||||
/**
|
||||
* A class, that can be used as a TouchListener on any view (e.g. a Button).
|
||||
* It cyclically runs a clickListener, emulating keyboard-like behaviour. First
|
||||
|
|
|
@ -54,7 +54,7 @@ public class UIUtils {
|
|||
|
||||
public static final int initialButtonRepeatInterval = 400; // ms
|
||||
public static final int buttonRepeatInterval = 80; // ms
|
||||
public static final int buttonVibrationDuration = 100; //ms
|
||||
public static final int buttonVibrationDuration = 50; //ms
|
||||
|
||||
/**
|
||||
* Formats time based on seconds
|
||||
|
@ -459,16 +459,18 @@ public class UIUtils {
|
|||
}
|
||||
|
||||
public static void handleVibration(Context context) {
|
||||
if(context != null) {
|
||||
Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
||||
//Check if we should vibrate
|
||||
boolean vibrateOnPress = PreferenceManager
|
||||
.getDefaultSharedPreferences(context)
|
||||
.getBoolean(Settings.KEY_PREF_VIBRATE_REMOTE_BUTTONS,
|
||||
if(context == null) return;
|
||||
|
||||
Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
||||
if (!vibrator.hasVibrator()) return;
|
||||
|
||||
//Check if we should vibrate
|
||||
boolean vibrateOnPress = PreferenceManager
|
||||
.getDefaultSharedPreferences(context)
|
||||
.getBoolean(Settings.KEY_PREF_VIBRATE_REMOTE_BUTTONS,
|
||||
Settings.DEFAULT_PREF_VIBRATE_REMOTE_BUTTONS);
|
||||
if (vibrateOnPress) {
|
||||
vibrator.vibrate(UIUtils.buttonVibrationDuration);
|
||||
}
|
||||
if (vibrateOnPress) {
|
||||
vibrator.vibrate(UIUtils.buttonVibrationDuration);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue