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:
@@ -8,6 +8,7 @@
|
|||||||
android:minSdkVersion="8"
|
android:minSdkVersion="8"
|
||||||
android:targetSdkVersion="19" />
|
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
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public abstract class FGestureAdapter extends InputAdapter {
|
|||||||
if (!longPressed) {
|
if (!longPressed) {
|
||||||
longPressed = true;
|
longPressed = true;
|
||||||
if (longPress(pointer1.x, pointer1.y)) {
|
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
|
endPress(pointer1.x, pointer1.y); //end press immediately if long press handled
|
||||||
longPressHandled = true;
|
longPressHandled = true;
|
||||||
}
|
}
|
||||||
@@ -66,7 +67,7 @@ public abstract class FGestureAdapter extends InputAdapter {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public FGestureAdapter() {
|
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
|
/** @param tapSquareSize0 half width in pixels of the square around an initial touch event
|
||||||
|
|||||||
Reference in New Issue
Block a user