1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-24 10:22:15 -05:00

small cleanups to messageview code

This commit is contained in:
Jesse Vincent 2010-12-13 01:56:57 +00:00
parent 063bbb904f
commit 5e7257492d

View File

@ -136,6 +136,9 @@ public class MessageView extends K9Activity implements OnClickListener
private Button mDownloadRemainder; private Button mDownloadRemainder;
private static Drawable answeredIcon;
View next; View next;
View next_scrolling; View next_scrolling;
View previous; View previous;
@ -502,7 +505,9 @@ public class MessageView extends K9Activity implements OnClickListener
{ {
mSubjectView.setText(subject); mSubjectView.setText(subject);
} }
mFromView.setText(from); mFromView.setText(from);
if (date != null) if (date != null)
{ {
mDateView.setText(date); mDateView.setText(date);
@ -520,14 +525,8 @@ public class MessageView extends K9Activity implements OnClickListener
mCcView.setText(cc); mCcView.setText(cc);
mAttachmentIcon.setVisibility(hasAttachments ? View.VISIBLE : View.GONE); mAttachmentIcon.setVisibility(hasAttachments ? View.VISIBLE : View.GONE);
if (flagged) mFlagged.setChecked(flagged);
{
mFlagged.setChecked(true);
}
else
{
mFlagged.setChecked(false);
}
mSubjectView.setTextColor(0xff000000 | defaultSubjectColor); mSubjectView.setTextColor(0xff000000 | defaultSubjectColor);
chip.setBackgroundColor(accountColor); chip.setBackgroundColor(accountColor);
@ -535,21 +534,11 @@ public class MessageView extends K9Activity implements OnClickListener
if (answered) if (answered)
{ {
Drawable answeredIcon = getResources().getDrawable( mSubjectView.setCompoundDrawablesWithIntrinsicBounds( answeredIcon, null,null,null);
R.drawable.ic_mms_answered_small);
mSubjectView.setCompoundDrawablesWithIntrinsicBounds(
answeredIcon, // left
null, // top
null, // right
null); // bottom
} }
else else
{ {
mSubjectView.setCompoundDrawablesWithIntrinsicBounds( mSubjectView.setCompoundDrawablesWithIntrinsicBounds(null,null,null,null);
null, // left
null, // top
null, // right
null); // bottom
} }
if (mMessage.isSet(Flag.X_DOWNLOADED_FULL)) if (mMessage.isSet(Flag.X_DOWNLOADED_FULL))
@ -857,6 +846,10 @@ public class MessageView extends K9Activity implements OnClickListener
mScreenReaderEnabled = isScreenReaderActive(); mScreenReaderEnabled = isScreenReaderActive();
answeredIcon = getResources().getDrawable(R.drawable.ic_mms_answered_small);
if (mScreenReaderEnabled) if (mScreenReaderEnabled)
{ {
mAccessibleMessageContentView.setVisibility(View.VISIBLE); mAccessibleMessageContentView.setVisibility(View.VISIBLE);