1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 09:08:49 -05:00

Merge pull request #179 from m0vie/message_view_theme_toggle

MessageView theme toggle: change the theme of the whole activity and not just the background of the WebView
This commit is contained in:
Andrew Chen 2012-09-14 23:36:03 -07:00
commit 9409435aa7
4 changed files with 12 additions and 7 deletions

View File

@ -164,8 +164,8 @@ http://k9mail.googlecode.com/
<string name="hide_full_header_action">Hide full header</string> <string name="hide_full_header_action">Hide full header</string>
<string name="select_text_action">Select text</string> <string name="select_text_action">Select text</string>
<string name="message_view_theme_action_dark">Change background to black</string> <string name="message_view_theme_action_dark">Switch to dark theme</string>
<string name="message_view_theme_action_light">Change background to white</string> <string name="message_view_theme_action_light">Switch to light theme</string>
<string name="mark_as_unread_action">Mark as unread</string> <string name="mark_as_unread_action">Mark as unread</string>
<string name="add_cc_bcc_action">Add Cc/Bcc</string> <string name="add_cc_bcc_action">Add Cc/Bcc</string>

View File

@ -303,6 +303,7 @@ public class MessageView extends K9Activity implements OnClickListener {
@Override @Override
public void onCreate(Bundle icicle) { public void onCreate(Bundle icicle) {
super.onCreate(icicle); super.onCreate(icicle);
setTheme(K9.getK9ThemeResourceId(K9.getK9MessageViewTheme()));
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.message_view); setContentView(R.layout.message_view);
@ -623,7 +624,14 @@ public class MessageView extends K9Activity implements OnClickListener {
return null; return null;
} }
}.execute(); }.execute();
displayMessage(mMessageReference);
// restart the current activity, so that the theme change can be applied
Intent intent = getIntent();
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
finish();
overridePendingTransition(0, 0); // disable animations to speed up the switch
startActivity(intent);
overridePendingTransition(0, 0);
} }
private void startRefileActivity(int activity) { private void startRefileActivity(int activity) {

View File

@ -98,9 +98,6 @@ public class MessageWebView extends TitleBarWebView {
// Black theme should get a black webview background // Black theme should get a black webview background
// we'll set the background of the messages on load // we'll set the background of the messages on load
this.setBackgroundColor(0xff000000); this.setBackgroundColor(0xff000000);
} else {
// multitoggle requires reset to white
this.setBackgroundColor(0xffffffff);
} }
final WebSettings webSettings = this.getSettings(); final WebSettings webSettings = this.getSettings();

View File

@ -720,7 +720,7 @@ public class SingleMessageView extends LinearLayout implements OnClickListener,
showShowPicturesAction(false); showShowPicturesAction(false);
mAttachments.removeAllViews(); mAttachments.removeAllViews();
mHiddenAttachments.removeAllViews(); mHiddenAttachments.removeAllViews();
mMessageContentView.configure();
/* /*
* Clear the WebView content * Clear the WebView content
* *