Merge branch 'Sudoku-v3.0' of https://github.com/SecUSo/privacy-friendly-sudoku into Sudoku-v3.0
This commit is contained in:
commit
f09028feed
5 changed files with 40 additions and 15 deletions
|
@ -83,10 +83,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);
|
||||
|
@ -100,6 +96,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.
|
||||
|
@ -169,12 +167,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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -185,13 +185,21 @@ 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);
|
||||
}});
|
||||
|
||||
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
|
||||
|
@ -243,9 +251,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;
|
||||
}
|
||||
|
|
|
@ -7,25 +7,27 @@
|
|||
<string name="menu_main">Hauptmenü</string>
|
||||
<string name="menu_help">Hilfe</string>
|
||||
<string name="menu_about">Über</string>
|
||||
<string name="create_game">Spiel erstellen</string>
|
||||
|
||||
<!-- Strings related to Settings -->
|
||||
<string name="title_activity_settings">Einstellungen</string>
|
||||
<string name="pref_dark_mode">Nachtmodus</string>
|
||||
<string name="pref_dark_mode_setting">Nachtmodus</string>
|
||||
<string name="pref_dark_mode_summary">Wechsel zwischen Tages und Nacht Modus</string>
|
||||
<string name="pref_dark_mode_summary">Wechsel zwischen Tages- und Nacht-Modus</string>
|
||||
|
||||
<!-- About Page -->
|
||||
<string name="about_affiliation">In Zusammenarbeit mit:</string>
|
||||
<string name="about_author">Autoren:</string>
|
||||
<string name="version_number">Version:</string>
|
||||
<string name="about_author_contributors">und Mitwirkende.</string>
|
||||
<string name="privacy_friendly">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.</string>
|
||||
<string name="privacy_friendly">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.</string>
|
||||
<string name="more_info">Weitere Infos unter:</string>
|
||||
|
||||
<!-- ###GameDifficulty### -->
|
||||
<string name="difficulty_easy">Leicht</string>
|
||||
<string name="difficulty_moderate">Normal</string>
|
||||
<string name="difficulty_hard">Schwer</string>
|
||||
<string name="difficulty_custom">Benutzerdefiniert</string>
|
||||
<string name="about_qqwing">Diese App benutzt eine modifizierte Version des QQWing v1.3.4.</string>
|
||||
<string name="average_time">Ø-Zeit:</string>
|
||||
<string name="cancel">Abbrechen</string>
|
||||
|
@ -74,7 +76,9 @@
|
|||
<string name="help_notes_summary">Schaltet zwischen Notizen- und Werteingabe hin und her</string>
|
||||
<string name="help_notes">Notizen</string>
|
||||
<string name="finalize">Fertigstellen</string>
|
||||
<string name="finalize_summary">Ist zur Bestätigung der Zahleneingabe im "Create Sudoku" Spielmodus </string>
|
||||
<string name="finalize_summary">Bestätigt die Zahleneingabe beim Erstellen eines benutzerdefinierten Sudokus </string>
|
||||
<string name="help_import">Importieren</string>
|
||||
<string name="help_import_summary">Importiert beim Erstellen eines benutzerdefinierten Sudokus ein neues, editierbares Sudoku-Feld.\nWarnung: Durch den Import werden alle zuvor eingetragenen Felder unwiderruflich überschrieben. </string>
|
||||
<string name="help_keyhighlighted_yellow_summary">Zeigt an, ob die korrekte Anzahl des Wertes im Spielfeld vorkommt.</string>
|
||||
<string name="help_keyhighlighted_summary">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.</string>
|
||||
<string name="help_keyboard">Tastatur</string>
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<string name="about_author_contributors">と貢献者。</string>
|
||||
<string name="version_number">バージョン</string>
|
||||
<string name="about_affiliation">提携</string>
|
||||
<string name="privacy_friendly">このアプリケーションは、ダルムシュタット工科大学 (Technische Universität Darmstadt, Germany) が開発したプライバシーフレンドリーアプリのグループに属しています。 ソースコードは GPLv3 の下でライセンスされます。画像の著作権は TU Darmstadt および Google Inc.</string>
|
||||
<string name="privacy_friendly">このアプリケーションは、カールスルーエ工科大学 (Karlsruher Institut für Technologie(KIT), Germany) が開発したプライバシーフレンドリーアプリのグループに属しています。 ソースコードは GPLv3 の下でライセンスされます。画像の著作権は KIT および Google Inc.</string>
|
||||
<string name="more_info">さらに詳しい情報は以下でご覧ください:</string>
|
||||
<string name="about_qqwing">このアプリケーションは QQWing v1.3.4 の修正版を使用しています</string>
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
<string name="menu_reset">Reset Board</string>
|
||||
<string name="menu_share">Share Board</string>
|
||||
<string name="menu_continue_game">Continue Game</string>
|
||||
<string name="create_game">Create Game</string>
|
||||
|
||||
<string name="navigation_drawer_open" translatable="false">Open navigation drawer</string>
|
||||
<string name="navigation_drawer_close" translatable="false">Close navigation drawer</string>
|
||||
|
@ -82,6 +83,7 @@
|
|||
<string name="difficulty_easy">Easy</string>
|
||||
<string name="difficulty_moderate">Moderate</string>
|
||||
<string name="difficulty_hard">Hard</string>
|
||||
<string name="difficulty_custom">Custom</string>
|
||||
|
||||
<!--###GameActivity -->
|
||||
<string name="Sudoku" translatable="false">Sudoku</string>
|
||||
|
@ -140,7 +142,9 @@
|
|||
<string name="help_notes">Note toggle button</string>
|
||||
<string name="help_notes_summary">Toggles if numbers should be set as notes or as values in a field</string>
|
||||
<string name="finalize">Finalize button</string>
|
||||
<string name="finalize_summary">Is used to confirm the numeric input in the create sudoku game mode </string>
|
||||
<string name="finalize_summary">Confirms the numeric input in the create sudoku game mode </string>
|
||||
<string name="help_import">Import button</string>
|
||||
<string name="help_import_summary">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.</string>
|
||||
<string name="help_privacyInfo">Privacy Info</string>
|
||||
<string name="help_permissions">Permissions</string>
|
||||
<string name="help_permissions_summary">Privacy Friendly Sudoku does not use any permissions.</string>
|
||||
|
|
|
@ -38,6 +38,10 @@
|
|||
android:selectable="false"
|
||||
android:icon="@drawable/ic_finalize"
|
||||
android:summary="@string/finalize_summary"/>
|
||||
<Preference android:title="@string/help_import"
|
||||
android:selectable="false"
|
||||
android:icon="@drawable/ic_import"
|
||||
android:summary="@string/help_import_summary"/>
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/help_privacyInfo">
|
||||
|
|
Loading…
Reference in a new issue