Merge "Fix bug 5594054 Crash seen while syncing Exchange" into ics-mr1

This commit is contained in:
Makoto Onuki 2011-11-10 15:47:21 -08:00 committed by Android (Google) Code Review
commit 22e4f6b671

View File

@ -313,17 +313,19 @@ public class MessageListItem extends View {
return;
}
boolean hasSubject = false;
int snippetStart = 0;
if (!TextUtils.isEmpty(mSubject)) {
int subjectColor = getFontColor(mRead ? SUBJECT_TEXT_COLOR_READ
: SUBJECT_TEXT_COLOR_UNREAD);
mText.setSpan(new ForegroundColorSpan(subjectColor), 0, mSubject.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
snippetStart = mSubject.length() + 1;
}
if (!TextUtils.isEmpty(mSnippet)) {
int snippetColor = getFontColor(mRead ? SNIPPET_TEXT_COLOR_READ
: SNIPPET_TEXT_COLOR_UNREAD);
mText.setSpan(new ForegroundColorSpan(snippetColor), mSubject.length() + 1, mText
.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
mText.setSpan(new ForegroundColorSpan(snippetColor), snippetStart, mText.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
}