From bf4f839caeb62503a93c8ec192c013fbd816fcc0 Mon Sep 17 00:00:00 2001 From: uykek Date: Tue, 30 Jun 2020 11:24:04 +0200 Subject: [PATCH] Replace hardcoded Strings in the CreateSudokuActivity and the CreateSudokuSpecialButtonLayout with string attributes. --- .../privacyfriendlysudoku/ui/CreateSudokuActivity.java | 6 +++--- .../ui/view/CreateSudokuSpecialButtonLayout.java | 4 ++-- app/src/main/res/values-de/strings.xml | 8 +++++++- app/src/main/res/values/strings.xml | 6 ++++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/CreateSudokuActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/CreateSudokuActivity.java index 2795084..a5b2768 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/CreateSudokuActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/CreateSudokuActivity.java @@ -113,7 +113,7 @@ public class CreateSudokuActivity extends BaseActivity implements IFinalizeDialo } public void onFinalizeDialogPositiveClick() { - Toast.makeText(CreateSudokuActivity.this, "Verifying...", Toast.LENGTH_SHORT).show(); + Toast.makeText(CreateSudokuActivity.this, R.string.verify_custom_sudoku_process_toast, Toast.LENGTH_SHORT).show(); GameType gameType = gameController.getGameType(); int boardSize = gameType.getSize() * gameType.getSize(); QQWing verifier = new QQWing(gameType, GameDifficulty.Unspecified); @@ -127,9 +127,9 @@ public class CreateSudokuActivity extends BaseActivity implements IFinalizeDialo boolean solvable = verifier.solve(); if(solvable) { - Toast.makeText(CreateSudokuActivity.this, "Done verifying!", Toast.LENGTH_SHORT).show(); + Toast.makeText(CreateSudokuActivity.this, R.string.finished_verifying_custom_sudoku_toast, Toast.LENGTH_SHORT).show(); } else { - Toast.makeText(CreateSudokuActivity.this, "Your sudoku cannot be solved!", Toast.LENGTH_LONG).show(); + Toast.makeText(CreateSudokuActivity.this, R.string.failed_to_verify_custom_sudoku_toast, Toast.LENGTH_LONG).show(); } } diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/CreateSudokuSpecialButtonLayout.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/CreateSudokuSpecialButtonLayout.java index af5faa6..2ae3b48 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/CreateSudokuSpecialButtonLayout.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/CreateSudokuSpecialButtonLayout.java @@ -211,8 +211,8 @@ public class CreateSudokuSpecialButtonLayout extends LinearLayout implements IHi public Dialog onCreateDialog(Bundle savedInstanceState) { // Use the Builder class for convenient dialog construction AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.AppTheme_Dialog); - builder.setMessage("Do you wish to finalize this sudoku?") - .setPositiveButton(R.string.hint_confirmation_confirm, new DialogInterface.OnClickListener() { + builder.setMessage(R.string.finalize_custom_sudoku_dialog) + .setPositiveButton(R.string.okay, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { for(IFinalizeDialogFragmentListener l : listeners) { l.onFinalizeDialogPositiveClick(); diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 05fbbd2..790e9e0 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -107,6 +107,12 @@ Du hast das Sudoku des Tages bereits gelöst. - Benutze Hinweise + Benutzte Hinweise + + + Möchtest du dieses Sudoku fertigstellen? + Verifiziere Level… + Verifizierung abgeschlossen! + Verifizierung fehlgeschlagen: Dein Sudoku kann nicht gelöst werden. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bc1304b..0ccd6a2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -166,4 +166,10 @@ Used hints Completed games + + Do you wish to finalize this sudoku? + Verifying… + Done verifying! + Verification failed: Your sudoku cannot be solved. +