From faf9dc6e0263e7cb3df1d09ebdeea6fb85777df8 Mon Sep 17 00:00:00 2001 From: cketti Date: Tue, 6 Mar 2012 04:26:18 +0100 Subject: [PATCH] Restored show/more less indicator in the message header --- res/layout/message_view_header.xml | 62 ++++++++++++++++++++++++- src/com/fsck/k9/view/MessageHeader.java | 11 ++++- 2 files changed, 69 insertions(+), 4 deletions(-) diff --git a/res/layout/message_view_header.xml b/res/layout/message_view_header.xml index 5b4d0d591..19bd2a52d 100644 --- a/res/layout/message_view_header.xml +++ b/res/layout/message_view_header.xml @@ -30,6 +30,7 @@ @@ -134,14 +135,56 @@ + + - + + + + + + + + + + + + + + @@ -188,6 +231,21 @@ android:textColor="?android:attr/textColorPrimary" android:textAppearance="?android:attr/textAppearanceSmall"/> + + + + + diff --git a/src/com/fsck/k9/view/MessageHeader.java b/src/com/fsck/k9/view/MessageHeader.java index f3f3b9a32..277885b95 100644 --- a/src/com/fsck/k9/view/MessageHeader.java +++ b/src/com/fsck/k9/view/MessageHeader.java @@ -59,6 +59,7 @@ public class MessageHeader extends ScrollView implements OnClickListener { private Account mAccount; private FontSizes mFontSizes = K9.getFontSizes(); private Contacts mContacts; + private ImageView mShowAdditionalHeadersIcon; private SavedState mSavedState; private OnLayoutChangedListener mOnLayoutChangedListener; @@ -98,6 +99,7 @@ public class MessageHeader extends ScrollView implements OnClickListener { mDateView = (TextView) findViewById(R.id.date); mTimeView = (TextView) findViewById(R.id.time); mFlagged = (CheckBox) findViewById(R.id.flagged); + mShowAdditionalHeadersIcon = (ImageView) findViewById(R.id.show_additional_headers_icon); defaultSubjectColor = mSubjectView.getCurrentTextColor(); mSubjectView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewSubject()); @@ -113,10 +115,13 @@ public class MessageHeader extends ScrollView implements OnClickListener { ((TextView) findViewById(R.id.to_label)).setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewTo()); ((TextView) findViewById(R.id.cc_label)).setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewCC()); - mToView.setOnClickListener(this); - mCcView.setOnClickListener(this); mFromView.setOnClickListener(this); findViewById(R.id.top_container).setOnClickListener(this); + + TextView dummyDateView = (TextView) findViewById(R.id.dummy_date); + TextView dummyTimeView = (TextView) findViewById(R.id.dummy_time); + dummyTimeView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewTime()); + dummyDateView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewDate()); } @Override @@ -168,6 +173,7 @@ public class MessageHeader extends ScrollView implements OnClickListener { private void hideAdditionalHeaders() { mAdditionalHeadersView.setVisibility(View.GONE); mAdditionalHeadersView.setText(""); + mShowAdditionalHeadersIcon.setImageResource(R.drawable.show_more); } @@ -186,6 +192,7 @@ public class MessageHeader extends ScrollView implements OnClickListener { // Show the additional headers that we have got. populateAdditionalHeadersView(additionalHeaders); mAdditionalHeadersView.setVisibility(View.VISIBLE); + mShowAdditionalHeadersIcon.setImageResource(R.drawable.show_less); } if (!allHeadersDownloaded) { /*