mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-25 00:58:50 -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:
commit
9409435aa7
@ -164,8 +164,8 @@ http://k9mail.googlecode.com/
|
||||
<string name="hide_full_header_action">Hide full header</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_light">Change background to white</string>
|
||||
<string name="message_view_theme_action_dark">Switch to dark theme</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="add_cc_bcc_action">Add Cc/Bcc</string>
|
||||
|
@ -303,6 +303,7 @@ public class MessageView extends K9Activity implements OnClickListener {
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
setTheme(K9.getK9ThemeResourceId(K9.getK9MessageViewTheme()));
|
||||
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||
setContentView(R.layout.message_view);
|
||||
|
||||
@ -623,7 +624,14 @@ public class MessageView extends K9Activity implements OnClickListener {
|
||||
return null;
|
||||
}
|
||||
}.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) {
|
||||
|
@ -98,9 +98,6 @@ public class MessageWebView extends TitleBarWebView {
|
||||
// Black theme should get a black webview background
|
||||
// we'll set the background of the messages on load
|
||||
this.setBackgroundColor(0xff000000);
|
||||
} else {
|
||||
// multitoggle requires reset to white
|
||||
this.setBackgroundColor(0xffffffff);
|
||||
}
|
||||
|
||||
final WebSettings webSettings = this.getSettings();
|
||||
|
@ -720,7 +720,7 @@ public class SingleMessageView extends LinearLayout implements OnClickListener,
|
||||
showShowPicturesAction(false);
|
||||
mAttachments.removeAllViews();
|
||||
mHiddenAttachments.removeAllViews();
|
||||
mMessageContentView.configure();
|
||||
|
||||
/*
|
||||
* Clear the WebView content
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user