Merge "Fix placement of invite icon in narrow mode"

This commit is contained in:
Marc Blank 2010-12-14 16:52:02 -08:00 committed by Android (Google) Code Review
commit ef2261fa00

View File

@ -413,9 +413,9 @@ public class MessageListItem extends View {
int left = mViewWidth - datePaddingRight - (int)sDefaultPaint.measureText(mFormattedDate, int left = mViewWidth - datePaddingRight - (int)sDefaultPaint.measureText(mFormattedDate,
0, mFormattedDate.length()) - sPaddingMedium; 0, mFormattedDate.length()) - sPaddingMedium;
int iconTop;
if (mHasAttachment) { if (mHasAttachment) {
left -= sAttachmentIcon.getWidth() + sPaddingSmall; left -= sAttachmentIcon.getWidth() + sPaddingSmall;
int iconTop;
if (mMode == MODE_WIDE) { if (mMode == MODE_WIDE) {
iconTop = (mViewHeight - sAttachmentIcon.getHeight()) / 2; iconTop = (mViewHeight - sAttachmentIcon.getHeight()) / 2;
} else { } else {
@ -425,7 +425,11 @@ public class MessageListItem extends View {
} }
if (mHasInvite) { if (mHasInvite) {
left -= sInviteIcon.getWidth() + sPaddingSmall; left -= sInviteIcon.getWidth() + sPaddingSmall;
int iconTop = (mViewHeight - sInviteIcon.getHeight()) / 2; if (mMode == MODE_WIDE) {
iconTop = (mViewHeight - sInviteIcon.getHeight()) / 2;
} else {
iconTop = senderY - sInviteIcon.getHeight();
}
canvas.drawBitmap(sInviteIcon, left, iconTop, sDefaultPaint); canvas.drawBitmap(sInviteIcon, left, iconTop, sDefaultPaint);
} }