Merge "Fix format/draw issues with snippets"

This commit is contained in:
Marc Blank 2010-12-31 10:50:23 -08:00 committed by Android (Google) Code Review
commit e70c2e0543

View File

@ -266,7 +266,7 @@ public class MessageListItem extends View {
for (int i = 0; i < MAX_SUBJECT_SNIPPET_LINES; i++) { for (int i = 0; i < MAX_SUBJECT_SNIPPET_LINES; i++) {
int start = layout.getLineStart(i); int start = layout.getLineStart(i);
if (i == MAX_SUBJECT_SNIPPET_LINES - 1) { if (i == MAX_SUBJECT_SNIPPET_LINES - 1) {
int end = mText.length() - 1; int end = mText.length();
if (start > end) continue; if (start > end) continue;
// For the final line, ellipsize the text to our width // For the final line, ellipsize the text to our width
mSnippetLines[i] = TextUtils.ellipsize(mText.subSequence(start, end), sDefaultPaint, mSnippetLines[i] = TextUtils.ellipsize(mText.subSequence(start, end), sDefaultPaint,
@ -381,7 +381,7 @@ public class MessageListItem extends View {
int subjectEnd = (mSubject == null) ? 0 : mSubject.length(); int subjectEnd = (mSubject == null) ? 0 : mSubject.length();
int lineStart = 0; int lineStart = 0;
TextPaint subjectPaint = mRead ? sDefaultPaint : sBoldPaint; TextPaint subjectPaint = mRead ? sDefaultPaint : sBoldPaint;
for (int i = 0; i < MAX_SUBJECT_SNIPPET_LINES; i++) { for (int i = 0; i < MAX_SUBJECT_SNIPPET_LINES && i < mSnippetLineCount; i++) {
CharSequence line = mSnippetLines[i]; CharSequence line = mSnippetLines[i];
int drawX = snippetX; int drawX = snippetX;
if (line != null) { if (line != null) {