+ int extension = 0;
+ if (actualSize < mOverflowPanel.getCount()) {
+ // The overflow will require scrolling to get to all the items.
+ // Extend the height so that part of the hidden items is displayed.
+ extension = (int) (getLineHeight(mContext) * 0.5f);
+ }
+ return actualSize * getLineHeight(mContext)
+ + mOverflowButtonSize.getHeight()
+ + extension;