mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-12 17:12:40 +01:00
DroidFish: Workaround for long press problem in movelist on android 4.1.
This commit is contained in:
@@ -183,6 +183,7 @@ public class DroidFish extends Activity implements GUIInterface {
|
||||
private TextView whiteTitleText, blackTitleText, engineTitleText;
|
||||
private View secondTitleLine;
|
||||
private TextView whiteFigText, blackFigText, summaryTitleText;
|
||||
private static Dialog moveListMenuDlg;
|
||||
|
||||
SharedPreferences settings;
|
||||
|
||||
@@ -2264,9 +2265,11 @@ public class DroidFish extends Activity implements GUIInterface {
|
||||
ctrl.makeHumanNullMove();
|
||||
break;
|
||||
}
|
||||
moveListMenuDlg = null;
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
moveListMenuDlg = alert;
|
||||
return alert;
|
||||
}
|
||||
|
||||
@@ -3074,9 +3077,15 @@ public class DroidFish extends Activity implements GUIInterface {
|
||||
}
|
||||
@Override
|
||||
public void onClick(View widget) {
|
||||
if (ctrl != null)
|
||||
if (ctrl != null) {
|
||||
// On android 4.1 this onClick method is called
|
||||
// even when you long click the move list. The test
|
||||
// below works around the problem.
|
||||
Dialog mlmd = moveListMenuDlg;
|
||||
if ((mlmd == null) || !mlmd.isShowing())
|
||||
ctrl.goNode(node);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void updateDrawState(TextPaint ds) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user