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

Commit 90d8491d authored by Adam Powell's avatar Adam Powell Committed by The Android Automerger
Browse files

Permit null adapters in Spinners

Bug 8538144

Change-Id: I83f0ae78ce15f46827fb721cd0df1972b7d9d198
parent fb01e4b6
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line
@@ -494,6 +494,8 @@ public class Spinner extends AbsSpinner implements OnClickListener {

        // Make selected view and position it
        mFirstPosition = mSelectedPosition;

        if (mAdapter != null) {
            View sel = makeAndAddView(mSelectedPosition);
            int width = sel.getMeasuredWidth();
            int selectedOffset = childrenLeft;
@@ -508,6 +510,7 @@ public class Spinner extends AbsSpinner implements OnClickListener {
                    break;
            }
            sel.offsetLeftAndRight(selectedOffset);
        }

        // Flush any cached views that did not get reused above
        mRecycler.clear();