Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25c6cd61 authored by Alan Viverette's avatar Alan Viverette
Browse files

Ensure child is attached before performing measure/layout in Spinner

Bug: 21614663
Change-Id: Id84a720fac7050d312eb2eb6f12621217c4f8d0f
parent b5a479c1
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -711,9 +711,7 @@ public class Spinner extends AbsSpinner implements OnClickListener {
            lp = generateDefaultLayoutParams();
        }

        if (addChild) {
        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