Fix bounds clipping to be based on app bounds

When PopupWindow location in LocalFloatingToolbarPopup is
set to 0, it will do 0-clipping so that the coords never go
negative. However, PopupWindow is positioned relative to
the ViewParent Window, and it's possible that this Window's
bounds are not set at (0, 0). For example, in Unity
apps, there's a separate Window just to host EditText).
Please take a look at this screenshot:
https://screenshot.googleplex.com/4koDnS4VvXbEuxE.png
Dumpsys: https://paste.googleplex.com/4609343505039360

In this case, even though the coords set is negative, it
should be acceptable as Window bounds (e.g. y=1000) +
negative coords (-200), will still show PopupWindow at y=800
for example.

Hence, the idea of this fix here is to clip only when
Window's bounds (where PopupWindow is anchored) + relative
PopupWindow coords is < appBounds.

Sample recordings in Pixel7a:
- Overlapping with text: http://shortn/_cxVdVlvbNF
- Popup hidden: http://shortn/_QnQzQ1GEG5
- After fix: http://shortn/_UG1C6cAGcg

Bug: 183233870
Test: atest CtsWidgetTestCases
Change-Id: Iffb7a3657fefdf6b0d100d17078527af3efb5461
1 file changed