diff --git a/res/menu/message_view_option.xml b/res/menu/message_view_option.xml
index c27a127c1..6aedc5846 100644
--- a/res/menu/message_view_option.xml
+++ b/res/menu/message_view_option.xml
@@ -72,4 +72,9 @@
android:title="@string/select_text_action"
android:showAsAction="never"
/>
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 26ae0cb63..b609fed61 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -164,6 +164,9 @@ http://k9mail.googlecode.com/
Hide full header
Select text
+ Change background to black
+ Change background to white
+
Mark as unread
Add Cc/Bcc
Read receipt
diff --git a/src/com/fsck/k9/K9.java b/src/com/fsck/k9/K9.java
index e40fa6e1f..c3d4602a5 100644
--- a/src/com/fsck/k9/K9.java
+++ b/src/com/fsck/k9/K9.java
@@ -78,6 +78,7 @@ public class K9 extends Application {
private static String language = "";
private static int theme = THEME_LIGHT;
+ private static int messageViewTheme = THEME_LIGHT;
private static final FontSizes fontSizes = new FontSizes();
@@ -458,6 +459,7 @@ public class K9 extends Application {
editor.putString("language", language);
editor.putInt("theme", theme);
+ editor.putInt("messageViewTheme", messageViewTheme);
editor.putBoolean("useGalleryBugWorkaround", useGalleryBugWorkaround);
editor.putBoolean("confirmDelete", mConfirmDelete);
@@ -661,6 +663,8 @@ public class K9 extends Application {
theme = THEME_LIGHT;
}
K9.setK9Theme(theme);
+
+ K9.setK9MessageViewTheme(sprefs.getInt("messageViewTheme", THEME_LIGHT));
}
private void maybeSetupStrictMode() {
@@ -727,6 +731,10 @@ public class K9 extends Application {
return getK9ThemeResourceId(theme);
}
+ public static int getK9MessageViewTheme() {
+ return messageViewTheme;
+ }
+
public static int getK9Theme() {
return theme;
}
@@ -735,6 +743,10 @@ public class K9 extends Application {
theme = ntheme;
}
+ public static void setK9MessageViewTheme(int nMessageViewTheme) {
+ messageViewTheme = nMessageViewTheme;
+ }
+
public static BACKGROUND_OPS getBackgroundOps() {
return backgroundOps;
}
diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java
index cc0aece75..7b0be8de3 100644
--- a/src/com/fsck/k9/activity/MessageView.java
+++ b/src/com/fsck/k9/activity/MessageView.java
@@ -9,7 +9,9 @@ import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
+import android.content.SharedPreferences.Editor;
import android.net.Uri;
+import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
@@ -72,6 +74,8 @@ public class MessageView extends K9Activity implements OnClickListener {
private MessageViewHandler mHandler = new MessageViewHandler();
private StorageManager.StorageListener mStorageListener = new StorageListenerImplementation();
+ private MenuItem mToggleMessageViewMenu;
+
/** this variable is used to save the calling AttachmentView
* until the onActivityResult is called.
* => with this reference we can identity the caller
@@ -602,6 +606,26 @@ public class MessageView extends K9Activity implements OnClickListener {
startRefileActivity(ACTIVITY_CHOOSE_FOLDER_COPY);
}
+ private void onToggleColors() {
+ if (K9.getK9MessageViewTheme() == K9.THEME_DARK) {
+ K9.setK9MessageViewTheme(K9.THEME_LIGHT);
+ } else {
+ K9.setK9MessageViewTheme(K9.THEME_DARK);
+ }
+
+ new AsyncTask