#688 - show section heading of first/general settings section in simple preferences view

This commit is contained in:
Daniel 2018-11-04 22:09:40 +01:00
parent 17d52a5f3a
commit 1cf5b80993
2 changed files with 11 additions and 1 deletions

View file

@ -190,10 +190,17 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
// In the simplified UI, fragments are not used at all and we instead
// use the older PreferenceActivity APIs.
// This is to initialize the settings panel to allow adding a first-section header (below)
// without running into stupid exceptions
addPreferencesFromResource(R.xml.pref_empty);
// Add 'general' preferences.
PreferenceCategory header = new PreferenceCategory(this);
header.setTitle(R.string.pref_header_general);
getPreferenceScreen().addPreference(header);
addPreferencesFromResource(R.xml.pref_general);
PreferenceCategory header = new PreferenceCategory(this);
header = new PreferenceCategory(this);
header.setTitle(R.string.pref_header_display);
getPreferenceScreen().addPreference(header);
addPreferencesFromResource(R.xml.pref_display);

View file

@ -0,0 +1,3 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<!-- This layout definition is EMPTY ON PURPOSE, it's needed to initialise a settings screen to add a first-section header to -->
</PreferenceScreen>