Respect PopupWindow.setOverlapAnchor when above anchor

Currently if a popup menu is shown above the anchor, it
is anchored to the anchor's top edge regardless of the value of
mOverlapAnchor.

Fixing the vertical offset correction and the computation of the
vertical space available above the anchor.

Bug: 36000552
Test: android.widget.cts.PopupWindowTest#testOverlapAnchor
Change-Id: Ifb71ff1fc0aa0df58e4919fd229c2623a2bcbe3d
1 file changed