diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 643faf1c..31535080 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="201" + android:versionName="9.5.0"> highlightedPositions = new ArrayList(); protected ArrayList moveToPositions = new ArrayList(); protected int soundTickTock, soundCheck, soundMove, soundCapture, soundNewGame; - protected boolean skipReturn = true, showMoves = false; + protected boolean skipReturn = true, showMoves = false, flipBoard = false; private String keyboardBuffer = ""; public boolean requestMove(final int from, final int to) { diff --git a/app/src/main/java/jwtc/android/chess/play/PlayActivity.java b/app/src/main/java/jwtc/android/chess/play/PlayActivity.java index 2f4b9926..e2e416a1 100644 --- a/app/src/main/java/jwtc/android/chess/play/PlayActivity.java +++ b/app/src/main/java/jwtc/android/chess/play/PlayActivity.java @@ -71,13 +71,14 @@ public class PlayActivity extends ChessBoardActivity implements SeekBar.OnSeekBa private ProgressBar progressBarEngine; private ImageButton playButton; private boolean vsCPU = true; + private boolean flipBoard = false; private int myTurn = 1, requestMoveFrom = -1, requestMoveTo = -1; private ChessPiecesStackView topPieces; private ChessPiecesStackView bottomPieces; private ViewSwitcher switchTurnMe, switchTurnOpp; private TextView textViewOpponent, textViewMe, textViewOpponentClock, textViewMyClock, textViewEngineValue, textViewEcoValue; private TableLayout layoutBoardTop, layoutBoardBottom; - private SwitchMaterial switchSound, switchBlindfold; + private SwitchMaterial switchSound, switchBlindfold, switchFlip; @Override public boolean requestMove(final int from, final int to) { @@ -224,6 +225,14 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { } }); + switchFlip = findViewById(R.id.SwitchFlip); + switchFlip.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + flipBoard = switchFlip.isChecked(); + updateBoardRotation(); + } + }); + } @Override @@ -357,11 +366,11 @@ protected void onPause() { editor.putString("game_pgn", gameApi.exportFullPGN()); editor.putString("FEN", null); // - editor.putLong("clockWhiteMillies", localClock.getWhiteRemaining()); editor.putLong("clockBlackMillies", localClock.getBlackRemaining()); editor.putLong("clockStartTime", localClock.getLastMeasureTime()); + editor.putBoolean("flipBoard", flipBoard); // if (_uriNotification == null) // editor.putString("NotificationUri", null); // else @@ -721,6 +730,10 @@ protected void updateForNewGame() { resetSelectedSquares(); } + protected void updateBoardRotation() { + chessBoardView.setRotated(myTurn == BoardConstants.BLACK && !flipBoard || myTurn == BoardConstants.WHITE && flipBoard); + } + protected void updateGameSettingsByPrefs() { SharedPreferences prefs = getPrefs(); @@ -741,7 +754,11 @@ protected void updateGameSettingsByPrefs() { myEngine.setQuiescentSearchOn(prefs.getBoolean("quiescentSearchOn", true)); - chessBoardView.setRotated(myTurn == BoardConstants.BLACK); + flipBoard = prefs.getBoolean("flipBoard", false); + + switchFlip.setChecked(flipBoard); + + updateBoardRotation(); playIfEngineMove(); } diff --git a/app/src/main/res/layout-land/play.xml b/app/src/main/res/layout-land/play.xml index e0d239ef..62513dfb 100644 --- a/app/src/main/res/layout-land/play.xml +++ b/app/src/main/res/layout-land/play.xml @@ -245,6 +245,13 @@ android:checked="true" android:nextFocusDown="@id/ButtonNext" > + diff --git a/app/src/main/res/layout/play.xml b/app/src/main/res/layout/play.xml index 7d8c66f4..d6eb1d59 100644 --- a/app/src/main/res/layout/play.xml +++ b/app/src/main/res/layout/play.xml @@ -219,6 +219,13 @@ android:text="@string/pref_sound" android:checked="true" > + diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index cd4b2b8f..e30c4310 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -155,7 +155,7 @@ PGN Werkzeug Über Beenden - Brett drehen + Drehen Mehr… Brett Einstellungen Von QR-code @@ -174,7 +174,7 @@ Geschlagenene Figuren Kommentiere Zug Rate den Zug - Blindschach Modus + Blindschach Spieler gegen Spieler Spieler gegen Android diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index cb7b184e..1527d9f3 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -176,7 +176,7 @@ Piezas capturadas Anota movimiento Adivina movimiento - Modo venda + Venda Humano contra Humano Human contra Android diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 9b3956ff..c6bc4fe7 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -163,7 +163,7 @@ Outil PGN A propos Quitter - Inverser l\'échiquier + Inverser Plus… Configuration de l\'échiquier Depuis un QR-code @@ -185,7 +185,7 @@ Pièces capturées Coups annotés Evaluer le coup - Mode aveugle + Aveugle Humain contre humain Humain contre Android diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 61203bcb..d6e47fa0 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -156,7 +156,7 @@ Strumento PGN Informazioni Esci - Inverti la scacchiera + Inverti Altro… Disponi la scacchiera Da QR Code @@ -176,7 +176,7 @@ Pezzi catturati Annota mossa Indovina la mossa - Modalità alla cieca + Benda Umano contro Umano Umano contro Android diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 4b11f4fe..5e79840a 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -156,7 +156,7 @@ FerramentaPGN Cerca de Saír - Virar tabuleiro + Virar Mais… Configurar tabuleiro Desde código-QR @@ -176,7 +176,7 @@ Peças capturadas Annotar jogada Adivinhar jogada - Modo venda + Venda Humano contra Human Humano contra Android diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index dd18f26b..e0c3cc6a 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -156,7 +156,7 @@ Инструмент PGN О приложении Выход - Перевернуть доску + вращать Ещё… Расстановка доски Из QR-кода diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 245dde77..75ef915f 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -156,7 +156,7 @@ PGN 工具 关于 退出 - 旋转棋盘 + 旋转 更多… 棋盘设置 来自二维码 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9f6c33c4..b5654909 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -164,7 +164,7 @@ PGN tool About Exit - Flip board + Rotate More… Setup board From QR-code @@ -186,7 +186,7 @@ Captured pieces Annotate move Guess the move - Blindfold mode + Blindfold Human vs Human Human vs Android