mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Reduce long press delay and vibrate when it's successful
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user