Merge branch 'Sudoku-v3.0' of https://github.com/SecUSo/privacy-friendly-sudoku into Sudoku-v3.0
This commit is contained in:
commit
ab90d7585b
7 changed files with 138 additions and 21 deletions
|
@ -213,16 +213,34 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
||||||
addPreferencesFromResource(R.xml.pref_settings_general);
|
addPreferencesFromResource(R.xml.pref_settings_general);
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
|
|
||||||
// Bind the summaries of EditText/List/Dialog/Ringtone preferences
|
|
||||||
// to their values. When their values change, their summaries are
|
|
||||||
// updated to reflect the new value, per the Android Design
|
|
||||||
// guidelines.
|
|
||||||
|
|
||||||
//bindPreferenceSummaryToValue(findPreference("example_text"));
|
PreferenceManager preferenceManager = getPreferenceManager();
|
||||||
//bindPreferenceSummaryToValue(findPreference("example_list"));
|
SharedPreferences sp = preferenceManager.getSharedPreferences();
|
||||||
|
|
||||||
}
|
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
|
|
||||||
|
if (sp.getBoolean("pref_dark_mode_setting", false)) {
|
||||||
|
//TwoStatePreference x = (TwoStatePreference) findPreference("pref_dark_mode_automatically_by_system");
|
||||||
|
//x.setEnabled(false);
|
||||||
|
findPreference("pref_dark_mode_automatically_by_system").setEnabled(false);
|
||||||
|
findPreference("pref_dark_mode_automatically_by_battery").setEnabled(false);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
findPreference("pref_dark_mode_automatically_by_system").setEnabled(!sp.getBoolean("pref_dark_mode_automatically_by_battery", false));
|
||||||
|
findPreference("pref_dark_mode_automatically_by_battery").setEnabled(!sp.getBoolean("pref_dark_mode_automatically_by_system", false));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bind the summaries of EditText/List/Dialog/Ringtone preferences
|
||||||
|
// to their values. When their values change, their summaries are
|
||||||
|
// updated to reflect the new value, per the Android Design
|
||||||
|
// guidelines.
|
||||||
|
|
||||||
|
//bindPreferenceSummaryToValue(findPreference("example_text"));
|
||||||
|
//bindPreferenceSummaryToValue(findPreference("example_list"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
|
@ -166,6 +166,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_weight="2"
|
android:layout_weight="2"
|
||||||
|
android:gravity="center"
|
||||||
android:text="@string/number_of_completed_games" />
|
android:text="@string/number_of_completed_games" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
@ -73,6 +73,8 @@
|
||||||
<string name="help_permissions">Berechtigungen</string>
|
<string name="help_permissions">Berechtigungen</string>
|
||||||
<string name="help_notes_summary">Schaltet zwischen Notizen- und Werteingabe hin und her</string>
|
<string name="help_notes_summary">Schaltet zwischen Notizen- und Werteingabe hin und her</string>
|
||||||
<string name="help_notes">Notizen</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="help_keyhighlighted_yellow_summary">Zeigt an, ob die korrekte Anzahl des Wertes im Spielfeld vorkommt.</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_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>
|
<string name="help_keyboard">Tastatur</string>
|
||||||
|
@ -109,7 +111,7 @@
|
||||||
<string name="menu_daily_sudoku">Sudoku des Tages</string>
|
<string name="menu_daily_sudoku">Sudoku des Tages</string>
|
||||||
<string name="finished_daily_sudoku">Du hast das Sudoku des Tages bereits gelöst.</string>
|
<string name="finished_daily_sudoku">Du hast das Sudoku des Tages bereits gelöst.</string>
|
||||||
<string name="daily_number_of_hints">Benutzte Hinweise</string>
|
<string name="daily_number_of_hints">Benutzte Hinweise</string>
|
||||||
|
<string name="number_of_completed_games">Abgeschlossene <br>Spiele</br></string>
|
||||||
<!-- ### Create custome sudoku ###-->
|
<!-- ### Create custome sudoku ###-->
|
||||||
<string name="menu_import_custom_sudoku">Sudoku importieren</string>
|
<string name="menu_import_custom_sudoku">Sudoku importieren</string>
|
||||||
<string name="finalize_custom_sudoku_dialog">Möchtest du dieses Sudoku fertigstellen?</string>
|
<string name="finalize_custom_sudoku_dialog">Möchtest du dieses Sudoku fertigstellen?</string>
|
||||||
|
|
|
@ -138,6 +138,8 @@
|
||||||
<string name="help_delete_summary">Deletes a selected field</string>
|
<string name="help_delete_summary">Deletes a selected field</string>
|
||||||
<string name="help_notes">Note toggle button</string>
|
<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="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="help_privacyInfo">Privacy Info</string>
|
<string name="help_privacyInfo">Privacy Info</string>
|
||||||
<string name="help_permissions">Permissions</string>
|
<string name="help_permissions">Permissions</string>
|
||||||
<string name="help_permissions_summary">Privacy Friendly Sudoku does not use any permissions.</string>
|
<string name="help_permissions_summary">Privacy Friendly Sudoku does not use any permissions.</string>
|
||||||
|
|
102
app/src/main/res/xml-v29/pref_settings_general.xml
Normal file
102
app/src/main/res/xml-v29/pref_settings_general.xml
Normal file
|
@ -0,0 +1,102 @@
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<PreferenceCategory android:title="@string/pref_group_game">
|
||||||
|
<SwitchPreference android:id="@+id/pref_automatic_note_deletion"
|
||||||
|
android:key="pref_automatic_note_deletion"
|
||||||
|
android:title="@string/pref_automatic_note_deletion"
|
||||||
|
android:summary="@string/pref_automatic_note_deletion_summary"
|
||||||
|
android:defaultValue="true"/>
|
||||||
|
|
||||||
|
<SwitchPreference android:id="@+id/pref_timer_reset"
|
||||||
|
android:key="pref_timer_reset"
|
||||||
|
android:title="@string/pref_timer_reset"
|
||||||
|
android:summary="@string/pref_timer_reset_summary"
|
||||||
|
android:defaultValue="true" />
|
||||||
|
|
||||||
|
<SwitchPreference android:id="@+id/pref_keep_screen_on"
|
||||||
|
android:key="pref_keep_screen_on"
|
||||||
|
android:title="@string/pref_keep_screen_on"
|
||||||
|
android:summary="@string/pref_keep_screen_on_summary"
|
||||||
|
android:defaultValue="true"/>
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:key="pref_symbols"
|
||||||
|
android:title="@string/pref_symbols"
|
||||||
|
android:defaultValue="Default"
|
||||||
|
android:entries="@array/pref_symbols_list_titles"
|
||||||
|
android:entryValues="@array/pref_symbols_list_values"
|
||||||
|
android:negativeButtonText="@null"
|
||||||
|
android:positiveButtonText="@null" />
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory android:title="@string/pref_group_dark_theme">
|
||||||
|
<SwitchPreference android:id="@+id/pref_dark_theme"
|
||||||
|
android:key="pref_dark_mode_setting"
|
||||||
|
android:title="@string/pref_dark_mode"
|
||||||
|
android:summary="@string/pref_dark_mode_summary"
|
||||||
|
android:defaultValue="true"/>
|
||||||
|
|
||||||
|
<SwitchPreference android:id="@+id/pref_dark_theme_automatically_by_system"
|
||||||
|
android:key="pref_dark_mode_automatically_by_system"
|
||||||
|
android:title="@string/pref_dark_mode_automatically_by_system"
|
||||||
|
android:summary="Dark theme is adapted to settings of the OS"
|
||||||
|
android:defaultValue="true"/>
|
||||||
|
|
||||||
|
<SwitchPreference android:id="@+id/pref_dark_theme_automatically_by_battery"
|
||||||
|
android:key="pref_dark_mode_automatically_by_battery"
|
||||||
|
android:title="@string/pref_dark_mode_automatically_by_battery"
|
||||||
|
android:summary="adjusts Dark theme automatically according to battery status "
|
||||||
|
android:defaultValue="true"/>
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory android:title="@string/pref_group_highlight_selection">
|
||||||
|
<SwitchPreference android:id="@+id/pref_highlight_connected"
|
||||||
|
android:key="pref_highlight_connected"
|
||||||
|
android:title="@string/pref_highlight_connected"
|
||||||
|
android:summary=""
|
||||||
|
android:defaultValue="true"/>
|
||||||
|
</PreferenceCategory>
|
||||||
|
<PreferenceCategory android:title="@string/pref_group_highlight_value">
|
||||||
|
<SwitchPreference android:id="@+id/pref_highlight_vals"
|
||||||
|
android:key="pref_highlight_vals"
|
||||||
|
android:title="@string/pref_highlight_vals"
|
||||||
|
android:summary=""
|
||||||
|
android:defaultValue="true"/>
|
||||||
|
<SwitchPreference android:id="@+id/pref_highlight_notes"
|
||||||
|
android:key="pref_highlight_notes"
|
||||||
|
android:title="@string/pref_highlight_notes"
|
||||||
|
android:summary=""
|
||||||
|
android:defaultValue="true"/>
|
||||||
|
<SwitchPreference android:id="@+id/pref_highlightInputError"
|
||||||
|
android:key="pref_highlightInputError"
|
||||||
|
android:title="@string/pref_highlightInputError"
|
||||||
|
android:summary=""
|
||||||
|
android:defaultValue="true"/>
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<!-- NOTE: EditTextPreference accepts EditText attributes. -->
|
||||||
|
<!-- NOTE: EditTextPreference's summary should be set to its value by the activity code. -->
|
||||||
|
<!-- <EditTextPreference
|
||||||
|
android:key="example_text"
|
||||||
|
android:title="@string/pref_title_display_name"
|
||||||
|
android:defaultValue="@string/pref_default_display_name"
|
||||||
|
android:selectAllOnFocus="true"
|
||||||
|
android:inputType="textCapWords"
|
||||||
|
android:capitalize="words"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:maxLines="1" /> -->
|
||||||
|
|
||||||
|
<!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to
|
||||||
|
dismiss it. -->
|
||||||
|
<!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
|
||||||
|
<!-- <ListPreference
|
||||||
|
android:key="example_list"
|
||||||
|
android:title="@string/pref_title_add_friends_to_messages"
|
||||||
|
android:defaultValue="-1"
|
||||||
|
android:entries="@array/pref_example_list_titles"
|
||||||
|
android:entryValues="@array/pref_example_list_values"
|
||||||
|
android:negativeButtonText="@null"
|
||||||
|
android:positiveButtonText="@null" /> -->
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
|
@ -34,6 +34,10 @@
|
||||||
android:selectable="false"
|
android:selectable="false"
|
||||||
android:icon="@drawable/ic_create_black_48dp"
|
android:icon="@drawable/ic_create_black_48dp"
|
||||||
android:summary="@string/help_notes_summary"/>
|
android:summary="@string/help_notes_summary"/>
|
||||||
|
<Preference android:title="@string/finalize"
|
||||||
|
android:selectable="false"
|
||||||
|
android:icon="@drawable/ic_finalize"
|
||||||
|
android:summary="@string/finalize_summary"/>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory android:title="@string/help_privacyInfo">
|
<PreferenceCategory android:title="@string/help_privacyInfo">
|
||||||
|
|
|
@ -36,18 +36,6 @@
|
||||||
android:summary="@string/pref_dark_mode_summary"
|
android:summary="@string/pref_dark_mode_summary"
|
||||||
android:defaultValue="true"/>
|
android:defaultValue="true"/>
|
||||||
|
|
||||||
<SwitchPreference android:id="@+id/pref_dark_theme_automatically_by_system"
|
|
||||||
android:key="pref_dark_mode_automatically_by_system"
|
|
||||||
android:title="@string/pref_dark_mode_automatically_by_system"
|
|
||||||
android:summary="Dark theme is adapted to settings of the OS"
|
|
||||||
android:defaultValue="true"/>
|
|
||||||
|
|
||||||
<SwitchPreference android:id="@+id/pref_dark_theme_automatically_by_battery"
|
|
||||||
android:key="pref_dark_mode_automatically_by_battery"
|
|
||||||
android:title="@string/pref_dark_mode_automatically_by_battery"
|
|
||||||
android:summary="adjusts Dark theme automatically according to battery status "
|
|
||||||
android:defaultValue="true"/>
|
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory android:title="@string/pref_group_highlight_selection">
|
<PreferenceCategory android:title="@string/pref_group_highlight_selection">
|
||||||
|
|
Loading…
Reference in a new issue