Fix PopupWindow's wrong location
Sometimes, we have seen cases that Popupwindow is located in the wrong place. So we suggest some modification of logics in tryFitVertical and tryFitHorizontal methods of PopupWindow. In those methods, there exists a statement whether the positions of anchor (anchorTopInScreen and anchorLeftInScreen) are bigger than 0. However, there are some cases that those values become positive even though corresponding popup windows are not visible to user (places out of window area), especially on devices with displaycuout, or apps with multiwindow modes. So we modify to the anchor's top and left position values should be compared with top and left value of displayFrame, respectively, not 0. Test: CtsWidgetTestCases:test android.widget.cts.PopupWindowTest Bug: b/135749682
Loading
Please register or sign in to comment