Made sure every PreferenceScreen has an associated key

If a PreferenceScreen has no associated key the screen can't be
restored after an orientation change (and the main screen is displayed)
This commit is contained in:
cketti 2012-06-06 15:03:46 +02:00
parent 42ee13741f
commit 2f7f7ad908
4 changed files with 28 additions and 14 deletions

View File

@ -18,6 +18,9 @@
Make sure to add android:persistent="false" to all preferences to disable saving Make sure to add android:persistent="false" to all preferences to disable saving
the preference values to SharedPreferences. We use our own storage mechanism for the preference values to SharedPreferences. We use our own storage mechanism for
the preferences. See com.fsck.k9.preferences.Storage. the preferences. See com.fsck.k9.preferences.Storage.
Also note that every sub-PreferenceScreen needs an "android:key" parameter so the correct screen
can be displayed after the device has been rotated.
--> -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
@ -43,7 +46,8 @@
</PreferenceScreen> </PreferenceScreen>
<PreferenceScreen <PreferenceScreen
android:title="@string/account_settings_display_prefs_title"> android:title="@string/account_settings_display_prefs_title"
android:key="display">
<PreferenceCategory <PreferenceCategory
android:title="@string/account_settings_message_lists" android:title="@string/account_settings_message_lists"
@ -82,7 +86,8 @@
</PreferenceScreen> </PreferenceScreen>
<PreferenceScreen <PreferenceScreen
android:title="@string/interaction_preferences"> android:title="@string/interaction_preferences"
android:key="interaction">
<CheckBoxPreference <CheckBoxPreference
android:persistent="false" android:persistent="false"
@ -341,7 +346,7 @@
</PreferenceScreen> </PreferenceScreen>
<PreferenceScreen <PreferenceScreen
android:title="@string/account_settings_storage_title" android:title="@string/account_settings_storage_title"
android:key="folders"> android:key="storage_provider">
<ListPreference <ListPreference
android:persistent="false" android:persistent="false"

View File

@ -18,6 +18,9 @@
Make sure to add android:persistent="false" to all preferences to disable saving Make sure to add android:persistent="false" to all preferences to disable saving
the preference values to SharedPreferences. We use our own storage mechanism for the preference values to SharedPreferences. We use our own storage mechanism for
the preferences. See com.fsck.k9.preferences.Storage. the preferences. See com.fsck.k9.preferences.Storage.
Also note that every sub-PreferenceScreen needs an "android:key" parameter so the correct screen
can be displayed after the device has been rotated.
--> -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

View File

@ -4,6 +4,9 @@
Make sure to add android:persistent="false" to all preferences to disable saving Make sure to add android:persistent="false" to all preferences to disable saving
the preference values to SharedPreferences. We use our own storage mechanism for the preference values to SharedPreferences. We use our own storage mechanism for
the preferences. See com.fsck.k9.preferences.Storage. the preferences. See com.fsck.k9.preferences.Storage.
Also note that every sub-PreferenceScreen needs an "android:key" parameter so the correct screen
can be displayed after the device has been rotated.
--> -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

View File

@ -18,6 +18,9 @@
Make sure to add android:persistent="false" to all preferences to disable saving Make sure to add android:persistent="false" to all preferences to disable saving
the preference values to SharedPreferences. We use our own storage mechanism for the preference values to SharedPreferences. We use our own storage mechanism for
the preferences. See com.fsck.k9.preferences.Storage. the preferences. See com.fsck.k9.preferences.Storage.
Also note that every sub-PreferenceScreen needs an "android:key" parameter so the correct screen
can be displayed after the device has been rotated.
--> -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
@ -66,13 +69,13 @@
android:key="animations" android:key="animations"
android:title="@string/animations_title" android:title="@string/animations_title"
android:summary="@string/animations_summary" /> android:summary="@string/animations_summary" />
<CheckBoxPreference <CheckBoxPreference
android:persistent="false" android:persistent="false"
android:key="compact_layouts" android:key="compact_layouts"
android:title="@string/compact_layouts_title" android:title="@string/compact_layouts_title"
android:summary="@string/compact_layouts_summary" /> android:summary="@string/compact_layouts_summary" />
</PreferenceCategory> </PreferenceCategory>
@ -157,7 +160,7 @@
android:dependency="messagelist_show_contact_name" android:dependency="messagelist_show_contact_name"
/> />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory <PreferenceCategory
@ -243,7 +246,7 @@
android:title="@string/global_settings_batch_buttons" android:title="@string/global_settings_batch_buttons"
android:summary="@string/global_settings_batch_buttons_summary" android:summary="@string/global_settings_batch_buttons_summary"
android:key="batch_buttons_settings"> android:key="batch_buttons_settings">
<CheckBoxPreference <CheckBoxPreference
android:persistent="false" android:persistent="false"
android:key="batch_buttons_mark_read" android:key="batch_buttons_mark_read"
@ -272,37 +275,37 @@
android:persistent="false" android:persistent="false"
android:key="batch_buttons_flag" android:key="batch_buttons_flag"
android:title="@string/global_settings_flag" android:title="@string/global_settings_flag"
/> />
<CheckBoxPreference <CheckBoxPreference
android:persistent="false" android:persistent="false"
android:key="batch_buttons_unselect" android:key="batch_buttons_unselect"
android:title="@string/global_settings_unselect" android:title="@string/global_settings_unselect"
/> />
</PreferenceScreen> </PreferenceScreen>
</PreferenceScreen> </PreferenceScreen>
<PreferenceScreen <PreferenceScreen
android:title="@string/notifications_title" android:title="@string/notifications_title"
android:key="notification_preferences"> android:key="notification_preferences">
<CheckBoxPreference <CheckBoxPreference
android:key="quiet_time_enabled" android:key="quiet_time_enabled"
android:persistent="false" android:persistent="false"
android:title="@string/quiet_time" android:title="@string/quiet_time"
android:summary="@string/quiet_time_description" android:summary="@string/quiet_time_description"
/> />
<com.fsck.k9.preferences.TimePickerPreference <com.fsck.k9.preferences.TimePickerPreference
android:key="quiet_time_starts" android:key="quiet_time_starts"
android:persistent="false" android:persistent="false"
android:dependency="quiet_time_enabled" android:dependency="quiet_time_enabled"
android:dialogTitle="@string/quiet_time_starts" android:dialogTitle="@string/quiet_time_starts"
android:title="@string/quiet_time_starts" android:title="@string/quiet_time_starts"
/> />
<com.fsck.k9.preferences.TimePickerPreference <com.fsck.k9.preferences.TimePickerPreference
android:key="quiet_time_ends" android:key="quiet_time_ends"
android:dependency="quiet_time_enabled" android:dependency="quiet_time_enabled"
android:persistent="false" android:persistent="false"
android:dialogTitle="@string/quiet_time_ends" android:dialogTitle="@string/quiet_time_ends"