From a09c96ee8309da18a1e1c6de447ed0f5caf219bb Mon Sep 17 00:00:00 2001 From: uykek Date: Wed, 26 Aug 2020 09:40:24 +0200 Subject: [PATCH 1/5] Update German and Japanese strings displayed in the AboutActivity --- app/src/main/res/values-de/strings.xml | 2 +- app/src/main/res/values-ja/strings.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 08b1c35..dc5ef97 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -19,7 +19,7 @@ Autoren: Version: und Mitwirkende. - Diese App gehört zur Gruppe der Privacy Friendly Apps entwickelt von der Technischen Universität Darmstadt. Quelltext lizenziert unter GPLv3. Bilder copyright TU Darmstadt und Google Inc. + Diese App gehört zur Gruppe der Privacy Friendly Apps entwickelt von dem Karlsruher Institut für Technologie (KIT). Quelltext lizenziert unter GPLv3. Bilder copyright KIT und Google Inc. Weitere Infos unter: diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index e4e2adf..af39731 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -52,7 +52,7 @@ と貢献者。 バージョン 提携 - このアプリケーションは、ダルムシュタット工科大学 (Technische Universität Darmstadt, Germany) が開発したプライバシーフレンドリーアプリのグループに属しています。 ソースコードは GPLv3 の下でライセンスされます。画像の著作権は TU Darmstadt および Google Inc. + このアプリケーションは、カールスルーエ工科大学 (Karlsruher Institut für Technologie(KIT), Germany) が開発したプライバシーフレンドリーアプリのグループに属しています。 ソースコードは GPLv3 の下でライセンスされます。画像の著作権は KIT および Google Inc. さらに詳しい情報は以下でご覧ください: このアプリケーションは QQWing v1.3.4 の修正版を使用しています From 0c92da5d597dedb8091bd5289d216338bfa74c3e Mon Sep 17 00:00:00 2001 From: uykek Date: Sat, 29 Aug 2020 10:02:40 +0200 Subject: [PATCH 2/5] Update string files with a few necessary strings --- app/src/main/res/values-de/strings.xml | 8 ++++++-- app/src/main/res/values/strings.xml | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index dc5ef97..452df43 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -7,12 +7,13 @@ Hauptmenü Hilfe Über + Spiel erstellen Einstellungen Nachtmodus Nachtmodus - Wechsel zwischen Tages und Nacht Modus + Wechsel zwischen Tages- und Nacht-Modus In Zusammenarbeit mit: @@ -26,6 +27,7 @@ Leicht Normal Schwer + Benutzerdefiniert Diese App benutzt eine modifizierte Version des QQWing v1.3.4. Ø-Zeit: Abbrechen @@ -74,7 +76,9 @@ Schaltet zwischen Notizen- und Werteingabe hin und her Notizen Fertigstellen - Ist zur Bestätigung der Zahleneingabe im "Create Sudoku" Spielmodus + Bestätigt die Zahleneingabe beim Erstellen eines benutzerdefinierten Sudokus + Importieren + Importiert beim Erstellen eines benutzerdefinierten Sudokus ein neues, editierbares Sudoku-Feld.\nWarnung: Durch den Import werden alle zuvor eingetragenen Felder unwiderruflich überschrieben. Zeigt an, ob die korrekte Anzahl des Wertes im Spielfeld vorkommt. Zeigt an, dass der Wert ausgewählt ist. Jede Berührung eines Feldes setzt in diesem Modus die Zahl direkt, ohne das Feld vorher auszuwählen. Tastatur diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3ea38d7..59e2880 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -14,6 +14,7 @@ Reset Board Share Board Continue Game + Create Game Open navigation drawer Close navigation drawer @@ -82,6 +83,7 @@ Easy Moderate Hard + Custom Sudoku @@ -140,7 +142,9 @@ Note toggle button Toggles if numbers should be set as notes or as values in a field Finalize button - Is used to confirm the numeric input in the create sudoku game mode + Confirms the numeric input in the create sudoku game mode + Import button + Imports a new, customizable sudoku field into the create sudoku game mode.\nWarning: this will override the entire field and its old values cannot be recovered. Privacy Info Permissions Privacy Friendly Sudoku does not use any permissions. From ee0ceceeb7a064ebea6d4c27ae7d6d625629109a Mon Sep 17 00:00:00 2001 From: uykek Date: Sat, 29 Aug 2020 10:03:21 +0200 Subject: [PATCH 3/5] Add import button to HelpActivity --- app/src/main/res/xml/pref_help_general.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/res/xml/pref_help_general.xml b/app/src/main/res/xml/pref_help_general.xml index 16300d3..153606e 100644 --- a/app/src/main/res/xml/pref_help_general.xml +++ b/app/src/main/res/xml/pref_help_general.xml @@ -38,6 +38,10 @@ android:selectable="false" android:icon="@drawable/ic_finalize" android:summary="@string/finalize_summary"/> + From e32cb3a4df65eb999a104f43ae8ac7beb40fe7a2 Mon Sep 17 00:00:00 2001 From: uykek Date: Sat, 29 Aug 2020 10:04:11 +0200 Subject: [PATCH 4/5] Fix bug in the MainActivity which made it possible for neither the circle checkbox nor the rating bar to be selected --- .../privacyfriendlysudoku/ui/MainActivity.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java index c3d1f18..35d1f21 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java @@ -84,10 +84,6 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig @Override protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - - settings = PreferenceManager.getDefaultSharedPreferences(this); if (settings.getBoolean("pref_dark_mode_setting", false )) { AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); @@ -101,6 +97,8 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); } + super.onCreate(savedInstanceState); + NewLevelManager newLevelManager = NewLevelManager.getInstance(getApplicationContext(), settings); // check if we need to pre generate levels. @@ -170,12 +168,14 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig @Override public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) { createGameBar.setChecked(false); - ((Button) findViewById(R.id.playButton)).setText("New Game"); + ((Button) findViewById(R.id.playButton)).setText(R.string.new_game); if (rating >= 1) { difficultyText.setText(getString(difficultyList.get((int) ratingBar.getRating() - 1).getStringResID())); } else { - difficultyText.setText("Custom Sudoku"); + difficultyText.setText(R.string.difficulty_custom); + createGameBar.setChecked(true); + ((Button)findViewById(R.id.playButton)).setText(R.string.create_game); } } }); @@ -186,7 +186,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig if (isChecked) { difficultyBar.setRating(0); - ((Button)findViewById(R.id.playButton)).setText("Create"); + ((Button)findViewById(R.id.playButton)).setText(R.string.create_game); } createGameBar.setChecked(isChecked); }}); From 86f8e3df015d7cdb0b5df3d83d0996ae26e156e2 Mon Sep 17 00:00:00 2001 From: uykek Date: Sat, 29 Aug 2020 11:21:09 +0200 Subject: [PATCH 5/5] Modify MainActivity so that the last GameType and GameDifficulty chosen are saved even if the user chose to create a custom sudoku instead of starting a new sudoku. --- .../ui/MainActivity.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java index 35d1f21..f6f6ae7 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java @@ -191,8 +191,16 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig createGameBar.setChecked(isChecked); }}); - GameDifficulty lastChosenDifficulty = GameDifficulty.valueOf(settings.getString("lastChosenDifficulty", "Moderate")); - //difficultyBar.setRating(GameDifficulty.getValidDifficultyList().indexOf(lastChosenDifficulty) + 1); + String retrievedDifficulty = settings.getString("lastChosenDifficulty", "Moderate"); + GameDifficulty lastChosenDifficulty = GameDifficulty.valueOf( + retrievedDifficulty.equals("Custom")? GameDifficulty.Unspecified.toString() : retrievedDifficulty); + + if (lastChosenDifficulty == GameDifficulty.Unspecified) { + difficultyBar.setRating(0); + createGameBar.setChecked(true); + } else { + difficultyBar.setRating(GameDifficulty.getValidDifficultyList().indexOf(lastChosenDifficulty) + 1); + } /*LayerDrawable stars = (LayerDrawable)difficultyBar.getProgressDrawable(); stars.getDrawable(2).setColorFilter(getResources().getColor(R.color.colorPrimary), PorterDuff.Mode.SRC_ATOP);//Color for Stars fully selected stars.getDrawable(1).setColorFilter(getResources().getColor(R.color.middleblue), PorterDuff.Mode.SRC_ATOP);//Color for Stars partially selected @@ -244,9 +252,14 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig case R.id.playButton: GameType gameType = GameType.getValidGameTypes().get(mViewPager.getCurrentItem()); if (((CheckBox)findViewById(R.id.circleButton)).isChecked()) { - // send everything to game activity + // start CreateSudokuActivity i = new Intent(this, CreateSudokuActivity.class); i.putExtra("gameType", gameType.name()); + + SharedPreferences.Editor editor = settings.edit(); + editor.putString("lastChosenGameType", gameType.name()); + editor.putString("lastChosenDifficulty", "Custom"); + editor.apply(); //i.putExtra("gameDifficulty", GameDifficulty.Easy); break; }