mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-27 14:15:16 +01:00
DroidFish: Fixed problem where a long press on the chess board could be interpreted as both a tap and a long press.
This commit is contained in:
parent
f05e0fe48a
commit
0a38bbbd7b
|
@ -692,6 +692,12 @@ public class DroidFish extends Activity implements GUIInterface {
|
|||
setEgtbHints(cb.getSelectedSquare());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onLongPress(MotionEvent e) {
|
||||
((Vibrator)getSystemService(Context.VIBRATOR_SERVICE)).vibrate(20);
|
||||
removeDialog(BOARD_MENU_DIALOG);
|
||||
showDialog(BOARD_MENU_DIALOG);
|
||||
}
|
||||
});
|
||||
cb.setOnTouchListener(new OnTouchListener() {
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
|
@ -708,13 +714,6 @@ public class DroidFish extends Activity implements GUIInterface {
|
|||
}
|
||||
}
|
||||
});
|
||||
cb.setOnLongClickListener(new OnLongClickListener() {
|
||||
public boolean onLongClick(View v) {
|
||||
removeDialog(BOARD_MENU_DIALOG);
|
||||
showDialog(BOARD_MENU_DIALOG);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
moveList.setOnLongClickListener(new OnLongClickListener() {
|
||||
public boolean onLongClick(View v) {
|
||||
|
|
|
@ -36,12 +36,14 @@ import org.petero.droidfish.gtb.Probe;
|
|||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.os.Vibrator;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.text.ClipboardManager;
|
||||
import android.text.TextUtils;
|
||||
|
@ -52,7 +54,6 @@ import android.view.MotionEvent;
|
|||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.View.OnKeyListener;
|
||||
import android.view.View.OnLongClickListener;
|
||||
import android.view.View.OnTouchListener;
|
||||
import android.view.Window;
|
||||
import android.widget.Button;
|
||||
|
@ -197,6 +198,11 @@ public class EditBoard extends Activity {
|
|||
handleClick(e);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public void onLongPress(MotionEvent e) {
|
||||
((Vibrator)getSystemService(Context.VIBRATOR_SERVICE)).vibrate(20);
|
||||
showDialog(EDIT_DIALOG);
|
||||
}
|
||||
private final void handleClick(MotionEvent e) {
|
||||
int sq = cb.eventToSquare(e);
|
||||
Move m = cb.mousePressed(sq);
|
||||
|
@ -218,13 +224,6 @@ public class EditBoard extends Activity {
|
|||
setEgtbHints(cb.getSelectedSquare());
|
||||
}
|
||||
});
|
||||
cb.setOnLongClickListener(new OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
showDialog(EDIT_DIALOG);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user