move foreground setting and backup setting to main settings screen

This commit is contained in:
Daniel Gultsch 2019-11-08 14:14:28 +01:00
parent 7cc2478f5c
commit aa50f8da9d
3 changed files with 20 additions and 15 deletions

View File

@ -93,7 +93,7 @@ public class Compatibility {
public static void removeUnusedPreferences(SettingsFragment settingsFragment) { public static void removeUnusedPreferences(SettingsFragment settingsFragment) {
List<PreferenceCategory> categories = Arrays.asList( List<PreferenceCategory> categories = Arrays.asList(
(PreferenceCategory) settingsFragment.findPreference("notification_category"), (PreferenceCategory) settingsFragment.findPreference("notification_category"),
(PreferenceCategory) settingsFragment.findPreference("other_expert_category")); (PreferenceCategory) settingsFragment.findPreference("advanced"));
for (String key : (runsTwentySix() ? UNUSED_SETTINGS_POST_TWENTYSIX : UNUESD_SETTINGS_PRE_TWENTYSIX)) { for (String key : (runsTwentySix() ? UNUSED_SETTINGS_POST_TWENTYSIX : UNUESD_SETTINGS_PRE_TWENTYSIX)) {
Preference preference = settingsFragment.findPreference(key); Preference preference = settingsFragment.findPreference(key);
if (preference != null) { if (preference != null) {

View File

@ -880,4 +880,6 @@
<string name="local_server">Local server</string> <string name="local_server">Local server</string>
<string name="pref_channel_discovery_summary">Most users should choose jabber.network for better suggestions from the entirety of the public XMPP ecosystem.</string> <string name="pref_channel_discovery_summary">Most users should choose jabber.network for better suggestions from the entirety of the public XMPP ecosystem.</string>
<string name="pref_channel_discovery">Channel discovery method</string> <string name="pref_channel_discovery">Channel discovery method</string>
<string name="backup">Backup</string>
<string name="category_about">About</string>
</resources> </resources>

View File

@ -184,6 +184,14 @@
android:summary="@string/pref_font_size_summary" android:summary="@string/pref_font_size_summary"
android:title="@string/pref_font_size" /> android:title="@string/pref_font_size" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory
android:key="backup_category"
android:title="@string/backup">
<Preference
android:key="create_backup"
android:summary="@string/pref_create_backup_summary"
android:title="@string/pref_create_backup" />
</PreferenceCategory>
<PreferenceCategory <PreferenceCategory
android:key="advanced" android:key="advanced"
android:title="@string/pref_advanced_options"> android:title="@string/pref_advanced_options">
@ -193,6 +201,12 @@
android:summary="@string/pref_never_send_crash_summary" android:summary="@string/pref_never_send_crash_summary"
android:title="@string/pref_never_send_crash" /> android:title="@string/pref_never_send_crash" />
<CheckBoxPreference
android:defaultValue="@bool/enable_foreground_service"
android:key="enable_foreground_service"
android:summary="@string/pref_keep_foreground_service_summary"
android:title="@string/pref_keep_foreground_service" />
<PreferenceScreen <PreferenceScreen
android:key="expert" android:key="expert"
android:summary="@string/pref_expert_options_summary" android:summary="@string/pref_expert_options_summary"
@ -320,19 +334,6 @@
android:summary="@string/pref_channel_discovery_summary" android:summary="@string/pref_channel_discovery_summary"
android:title="@string/pref_channel_discovery" /> android:title="@string/pref_channel_discovery" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory
android:key="other_expert_category"
android:title="@string/pref_expert_options_other">
<CheckBoxPreference
android:defaultValue="@bool/enable_foreground_service"
android:key="enable_foreground_service"
android:summary="@string/pref_keep_foreground_service_summary"
android:title="@string/pref_keep_foreground_service" />
<Preference
android:key="create_backup"
android:summary="@string/pref_create_backup_summary"
android:title="@string/pref_create_backup" />
</PreferenceCategory>
<intent <intent
android:action="android.intent.action.VIEW" android:action="android.intent.action.VIEW"
android:targetClass="eu.siacs.conversations.ui.SettingsActivity" android:targetClass="eu.siacs.conversations.ui.SettingsActivity"
@ -343,5 +344,7 @@
</intent> </intent>
</PreferenceScreen> </PreferenceScreen>
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:title="@string/category_about">
<eu.siacs.conversations.ui.AboutPreference /> <eu.siacs.conversations.ui.AboutPreference />
</PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>