mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-21 09:01:56 -07:00
Changed gestureDetector to the singleTapDetector
This commit is contained in:
parent
0dcc6987c9
commit
2bd8fae66d
1 changed files with 6 additions and 4 deletions
|
|
@ -96,7 +96,8 @@ public class BaseMainActivity extends LoggableActivity {
|
||||||
private TextView textLog;
|
private TextView textLog;
|
||||||
private ScrollView contentScroll;
|
private ScrollView contentScroll;
|
||||||
private ToggleButton toggleLog;
|
private ToggleButton toggleLog;
|
||||||
private GestureDetector gestureDetector;
|
|
||||||
|
private TapDetector singleTapDetector;
|
||||||
private TapDetector doubleTapDetector;
|
private TapDetector doubleTapDetector;
|
||||||
|
|
||||||
private TextView debugText;
|
private TextView debugText;
|
||||||
|
|
@ -164,7 +165,8 @@ public class BaseMainActivity extends LoggableActivity {
|
||||||
System.out.println("WidthHeight: " + windowWidth + ":" + windowHeight);
|
System.out.println("WidthHeight: " + windowWidth + ":" + windowHeight);
|
||||||
|
|
||||||
|
|
||||||
gestureDetector = new GestureDetector(this, new SingleTapConfirm());
|
|
||||||
|
singleTapDetector = new TapDetector(1, TapDetector.DETECTION_METHOD_UP);
|
||||||
doubleTapDetector = new TapDetector(2, TapDetector.DETECTION_METHOD_DOWN);
|
doubleTapDetector = new TapDetector(2, TapDetector.DETECTION_METHOD_DOWN);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -262,7 +264,7 @@ public class BaseMainActivity extends LoggableActivity {
|
||||||
float mouseX = mousePointer.getX();
|
float mouseX = mousePointer.getX();
|
||||||
float mouseY = mousePointer.getY();
|
float mouseY = mousePointer.getY();
|
||||||
|
|
||||||
if (gestureDetector.onTouchEvent(event)) {
|
if (singleTapDetector.onTouchEvent(event)) {
|
||||||
mouse_x = (mouseX * scaleFactor);
|
mouse_x = (mouseX * scaleFactor);
|
||||||
mouse_y = (mouseY * scaleFactor);
|
mouse_y = (mouseY * scaleFactor);
|
||||||
CallbackBridge.sendCursorPos(mouse_x, mouse_y);
|
CallbackBridge.sendCursorPos(mouse_x, mouse_y);
|
||||||
|
|
@ -354,7 +356,7 @@ public class BaseMainActivity extends LoggableActivity {
|
||||||
mouse_x = (e.getX() * scaleFactor);
|
mouse_x = (e.getX() * scaleFactor);
|
||||||
mouse_y = (e.getY() * scaleFactor);
|
mouse_y = (e.getY() * scaleFactor);
|
||||||
//One android click = one MC click
|
//One android click = one MC click
|
||||||
if(gestureDetector.onTouchEvent(e)){
|
if(singleTapDetector.onTouchEvent(e)){
|
||||||
CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0, (int)mouse_x, (int)mouse_y);
|
CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0, (int)mouse_x, (int)mouse_y);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue