From a74d57cb71d67e42e1db709e00d5fd514b1ecd0c Mon Sep 17 00:00:00 2001 From: m0viefreak Date: Mon, 4 Feb 2013 18:04:34 +0100 Subject: [PATCH] MessageView: Theme fix when global and message view theme differ - Since the split-view change, MessageView is only a fragment, so we can't call setTheme() anymore so easily. Instead, use a ContextThemeWrapper and use that to inflate the layout. This way the message header and attachment view are styled correctly. - The HTC WebView fix in SingleMessageView was returning the wrong background color, when message view theme and global theme differ, because it always used the global theme to retrieve it. Fix: Specifically put the light/dark values in the themes.xml, and get them using getContext().getTheme().resolveAttribute(). getContext() will use the ContextThemeWrapper from above, so even if the global and message view themes differ, it aleays returns the correct one. The getThemeBackgroundColor() method added to the K9ActivityMagic interface in 309eeb72ac3c4fb2b93766550eed24e5cab39bb8 is now not needed anymore, and was removed. --- res/values/attrs.xml | 1 + res/values/themes.xml | 2 ++ src/com/fsck/k9/activity/K9Activity.java | 5 ----- src/com/fsck/k9/activity/K9ActivityCommon.java | 1 - src/com/fsck/k9/activity/K9FragmentActivity.java | 5 ----- src/com/fsck/k9/activity/K9ListActivity.java | 5 ----- src/com/fsck/k9/fragment/MessageViewFragment.java | 7 +++++-- src/com/fsck/k9/view/SingleMessageView.java | 7 +++++-- 8 files changed, 13 insertions(+), 20 deletions(-) diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 36f205af5..dc0ba11c6 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -50,6 +50,7 @@ + diff --git a/res/values/themes.xml b/res/values/themes.xml index f39ed8140..1ebaaa9fa 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -49,6 +49,7 @@ @drawable/thread_count_box_light #ff2ea7d1 #ffcccccc + #ffffffff