Skip to content
Commit 63ee7f16 authored by Mihai Popa's avatar Mihai Popa
Browse files

[Magnifier-39] Hide both handles on overlap

In general, since text insertion/selection handles are implemented as
PopupWindows, if they get to overlap the magnifier they are going to be
rendered above it. Therefore, we are trying to avoid this case.

Before this CL, we were only hiding the grabbed handle, when this would
overlap the magnifier. Since the magnifier would usually be displayed a
certain offset above the grabbed handle, this could only possibly happen
when there was not enough space for the magnifier above in the current
surface.

However, this is not enough, as in the case of selection, the other
handle could as well overlap the magnifier in certain cases. This CL
intersects the magnifier rectangle with the rectangles of both handles
and detects whether these should hidden or not.

Bug: 76459199
Test: atest FrameworksCoreTests:android.widget.TextViewActivityTest
Test: atest FrameworksCoreTests:android.widget.TextViewTest
Change-Id: I22519979eead276dbcf273f7c1a54d654fa251bc
parent 74519453
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment