diff --git a/res/layout-land/actionbar_custom.xml b/res/layout-land/actionbar_custom.xml index 70d16a495..03474119e 100644 --- a/res/layout-land/actionbar_custom.xml +++ b/res/layout-land/actionbar_custom.xml @@ -1,50 +1,72 @@ - + android:layout_height="wrap_content" > + android:orientation="horizontal" > + + + + + + + + + + android:paddingLeft="12dip" + android:paddingRight="12dip" + android:textColor="?android:attr/textColorTertiary" + android:textSize="32sp" /> + - + + + android:includeFontPadding="false" + android:maxLines="2" + android:textSize="16sp" /> - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/res/layout/actionbar_custom.xml b/res/layout/actionbar_custom.xml index 107b139a3..9317c7bba 100644 --- a/res/layout/actionbar_custom.xml +++ b/res/layout/actionbar_custom.xml @@ -1,50 +1,72 @@ - + android:layout_height="wrap_content" > + android:orientation="horizontal" > + + + + + + + + + + android:paddingLeft="12dip" + android:paddingRight="12dip" + android:textColor="?android:attr/textColorTertiary" + android:textSize="36sp" /> + - + + + android:includeFontPadding="false" + android:maxLines="2" + android:textSize="16sp" /> - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/res/layout/message_view_header.xml b/res/layout/message_view_header.xml index e41e0e862..4d5c7dd9a 100644 --- a/res/layout/message_view_header.xml +++ b/res/layout/message_view_header.xml @@ -44,8 +44,7 @@ android:textSize="10sp" android:textStyle="bold" android:textColor="?android:attr/textColorSecondary" - android:textAppearance="?android:attr/textAppearanceSmall" - android:visibility="gone"/> + android:textAppearance="?android:attr/textAppearanceSmall"/> return to full message list } diff --git a/src/com/fsck/k9/fragment/MessageViewFragment.java b/src/com/fsck/k9/fragment/MessageViewFragment.java index caf5a62db..524d40501 100644 --- a/src/com/fsck/k9/fragment/MessageViewFragment.java +++ b/src/com/fsck/k9/fragment/MessageViewFragment.java @@ -791,6 +791,12 @@ public class MessageViewFragment extends SherlockFragment implements OnClickList && mAccount.hasSpamFolder()); } + public void updateTitle() { + if (mMessage != null) { + displayMessageSubject(mMessage.getSubject()); + } + } + public interface MessageViewFragmentListener { public void onForward(Message mMessage, PgpData mPgpData); public void disableDeleteAction(); diff --git a/src/com/fsck/k9/view/MessageHeader.java b/src/com/fsck/k9/view/MessageHeader.java index 4c101f7b6..e63152b69 100644 --- a/src/com/fsck/k9/view/MessageHeader.java +++ b/src/com/fsck/k9/view/MessageHeader.java @@ -431,10 +431,7 @@ public class MessageHeader extends ScrollView implements OnClickListener { } } - /** - * The subject line defaults to GONE. Make it visible. - */ - public void showSubjectLine() { - mSubjectView.setVisibility(VISIBLE); + public void hideSubjectLine() { + mSubjectView.setVisibility(GONE); } } diff --git a/src/com/fsck/k9/view/MessageTitleView.java b/src/com/fsck/k9/view/MessageTitleView.java index 96a3b23d3..0fe388ea3 100644 --- a/src/com/fsck/k9/view/MessageTitleView.java +++ b/src/com/fsck/k9/view/MessageTitleView.java @@ -3,16 +3,15 @@ package com.fsck.k9.view; import android.content.Context; import android.graphics.Canvas; import android.util.AttributeSet; -import android.util.Log; import android.widget.TextView; -import com.fsck.k9.K9; /** - * This {@link TextView} is used in the title of the {@link com.fsck.k9.activity.MessageView} ActionBar. - * It'll un-hide the subject line {@link MessageHeader} if it doesn't fit in the ActionBar's title area. + * This {@link TextView} is used in the custom view of the {@link com.fsck.k9.activity.MessageList} + * action bar. + * It will hide the subject line in {@link MessageHeader} if the subject fits completely into the + * action bar's title view. */ public class MessageTitleView extends TextView { - private static final String LOG_PREFIX = "MessageTitleView: "; private MessageHeader mHeader; public MessageTitleView(Context context) { @@ -28,28 +27,17 @@ public class MessageTitleView extends TextView { } /** - * Check to see if we need to unhide the subject line in the MessageHeader or not. - * @param canvas Canvas to draw on. + * Check to see if we need to hide the subject line in {@link MessageHeader} or not. */ @Override public void onDraw(Canvas canvas) { - if(mHeader != null && getLayout() != null) { - if(getLayout().getEllipsisCount(1) > 0) { - if(K9.DEBUG) { - Log.d(K9.LOG_TAG, LOG_PREFIX + - "Subject was truncated; enabling the subject line in the message header."); - } - mHeader.showSubjectLine(); - } else { - if (K9.DEBUG) { - Log.d(K9.LOG_TAG, LOG_PREFIX + "Subject was fully shown in ActionBar."); - } - } + if (mHeader != null && getLayout() != null && getLayout().getEllipsisCount(1) == 0) { + mHeader.hideSubjectLine(); } super.onDraw(canvas); } public void setMessageHeader(final MessageHeader header) { - this.mHeader = header; + mHeader = header; } }