Fix bug 5594054 Crash seen while syncing Exchange

bug 5594054

Change-Id: Id14598c4da66c0f2c78a7c892f653b6cee781f3b
This commit is contained in:
Makoto Onuki 2011-11-10 15:17:46 -08:00
parent 1b04f02300
commit c1d9be5dc3
1 changed files with 4 additions and 2 deletions

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);
}
}