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 TextView whiteTitleText, blackTitleText, engineTitleText;
|
||||||
private View secondTitleLine;
|
private View secondTitleLine;
|
||||||
private TextView whiteFigText, blackFigText, summaryTitleText;
|
private TextView whiteFigText, blackFigText, summaryTitleText;
|
||||||
|
private static Dialog moveListMenuDlg;
|
||||||
|
|
||||||
SharedPreferences settings;
|
SharedPreferences settings;
|
||||||
|
|
||||||
@@ -2264,9 +2265,11 @@ public class DroidFish extends Activity implements GUIInterface {
|
|||||||
ctrl.makeHumanNullMove();
|
ctrl.makeHumanNullMove();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
moveListMenuDlg = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
AlertDialog alert = builder.create();
|
AlertDialog alert = builder.create();
|
||||||
|
moveListMenuDlg = alert;
|
||||||
return alert;
|
return alert;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3074,8 +3077,14 @@ public class DroidFish extends Activity implements GUIInterface {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View widget) {
|
public void onClick(View widget) {
|
||||||
if (ctrl != null)
|
if (ctrl != null) {
|
||||||
ctrl.goNode(node);
|
// 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
|
@Override
|
||||||
public void updateDrawState(TextPaint ds) {
|
public void updateDrawState(TextPaint ds) {
|
||||||
|
|||||||
Reference in New Issue
Block a user