Reduce long press delay and vibrate when it's successful

This commit is contained in:
drdev
2014-05-14 01:03:30 +00:00
parent 51670f1144
commit 0a8d2303e1
2 changed files with 4 additions and 2 deletions

View File

@@ -7,7 +7,8 @@
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<application
android:allowBackup="true"

View File

@@ -48,6 +48,7 @@ public abstract class FGestureAdapter extends InputAdapter {
if (!longPressed) {
longPressed = true;
if (longPress(pointer1.x, pointer1.y)) {
Gdx.input.vibrate(200); //perform a quick vibrate to signify a successful long press
endPress(pointer1.x, pointer1.y); //end press immediately if long press handled
longPressHandled = true;
}
@@ -66,7 +67,7 @@ public abstract class FGestureAdapter extends InputAdapter {
};
public FGestureAdapter() {
this(Utils.AVG_FINGER_WIDTH / 4f, DOUBLE_TAP_INTERVAL, 0.05f, 1.1f, 0.025f, 0.15f);
this(Utils.AVG_FINGER_WIDTH / 2f, DOUBLE_TAP_INTERVAL, 0.05f, 0.75f, 0.025f, 0.15f);
}
/** @param tapSquareSize0 half width in pixels of the square around an initial touch event