1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-24 08:38:51 -05:00

Don't blindly use the saved display mode value

This commit is contained in:
cketti 2013-02-06 21:18:32 +01:00
parent 1244cc864a
commit 610af1dfe5

View File

@ -293,17 +293,24 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
* {@link #onCreate(Bundle)}. May be {@code null}. * {@link #onCreate(Bundle)}. May be {@code null}.
*/ */
private void initializeDisplayMode(Bundle savedInstanceState) { private void initializeDisplayMode(Bundle savedInstanceState) {
if (savedInstanceState != null) {
mDisplayMode = (DisplayMode) savedInstanceState.getSerializable(STATE_DISPLAY_MODE);
} else {
boolean displayMessage = (mMessageReference != null);
mDisplayMode = (displayMessage) ? DisplayMode.MESSAGE_VIEW : DisplayMode.MESSAGE_LIST;
}
if (useSplitView()) { if (useSplitView()) {
mDisplayMode = DisplayMode.SPLIT_VIEW; mDisplayMode = DisplayMode.SPLIT_VIEW;
} else if (mMessageViewFragment != null || mDisplayMode == DisplayMode.MESSAGE_VIEW) { return;
}
if (savedInstanceState != null) {
DisplayMode savedDisplayMode =
(DisplayMode) savedInstanceState.getSerializable(STATE_DISPLAY_MODE);
if (savedDisplayMode != DisplayMode.SPLIT_VIEW) {
mDisplayMode = savedDisplayMode;
return;
}
}
if (mMessageViewFragment != null || mMessageReference != null) {
mDisplayMode = DisplayMode.MESSAGE_VIEW; mDisplayMode = DisplayMode.MESSAGE_VIEW;
} else {
mDisplayMode = DisplayMode.MESSAGE_LIST;
} }
} }