Merge "Don't layout with 0 width if we've got a real width"
This commit is contained in:
commit
c0604d9648
@ -243,14 +243,16 @@ public class MessageListItem extends View {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
mViewWidth = MeasureSpec.getSize(widthMeasureSpec);
|
if (widthMeasureSpec != 0 || mViewWidth == 0) {
|
||||||
int mode = getViewMode(mViewWidth);
|
mViewWidth = MeasureSpec.getSize(widthMeasureSpec);
|
||||||
if (mode != mMode) {
|
int mode = getViewMode(mViewWidth);
|
||||||
// If the mode has changed, set the snippet line count to indicate layout required
|
if (mode != mMode) {
|
||||||
mMode = mode;
|
// If the mode has changed, set the snippet line count to indicate layout required
|
||||||
mSnippetLineCount = NEEDS_LAYOUT;
|
mMode = mode;
|
||||||
|
mSnippetLineCount = NEEDS_LAYOUT;
|
||||||
|
}
|
||||||
|
mViewHeight = measureHeight(heightMeasureSpec, mMode);
|
||||||
}
|
}
|
||||||
mViewHeight = measureHeight(heightMeasureSpec, mMode);
|
|
||||||
setMeasuredDimension(mViewWidth, mViewHeight);
|
setMeasuredDimension(mViewWidth, mViewHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user