Don't layout with 0 width if we've got a real width

Bug: 3221168
Change-Id: I85562cad4afe7ce494cdb4cd348cad23c6103936
This commit is contained in:
Marc Blank 2010-11-22 17:43:11 -08:00
parent 51f5cd7c16
commit 452b347729

View File

@ -243,6 +243,7 @@ public class MessageListItem extends View {
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (widthMeasureSpec != 0 || mViewWidth == 0) {
mViewWidth = MeasureSpec.getSize(widthMeasureSpec);
int mode = getViewMode(mViewWidth);
if (mode != mMode) {
@ -251,6 +252,7 @@ public class MessageListItem extends View {
mSnippetLineCount = NEEDS_LAYOUT;
}
mViewHeight = measureHeight(heightMeasureSpec, mMode);
}
setMeasuredDimension(mViewWidth, mViewHeight);
}