Merge "Ensure child is attached before performing measure/layout in Spinner" into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ed0e11a93a
@@ -711,9 +711,7 @@ public class Spinner extends AbsSpinner implements OnClickListener {
|
||||
lp = generateDefaultLayoutParams();
|
||||
}
|
||||
|
||||
if (addChild) {
|
||||
addViewInLayout(child, 0, lp);
|
||||
}
|
||||
addViewInLayout(child, 0, lp);
|
||||
|
||||
child.setSelected(hasFocus());
|
||||
if (mDisableChildrenWhenDisabled) {
|
||||
@@ -743,6 +741,10 @@ public class Spinner extends AbsSpinner implements OnClickListener {
|
||||
childRight = childLeft + width;
|
||||
|
||||
child.layout(childLeft, childTop, childRight, childBottom);
|
||||
|
||||
if (!addChild) {
|
||||
removeViewInLayout(child);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user