OSDN Git Service

[Magnifier-34] Keep magnifier inside its surface
authorMihai Popa <popam@google.com>
Wed, 21 Mar 2018 18:05:13 +0000 (18:05 +0000)
committerMihai Popa <popam@google.com>
Fri, 23 Mar 2018 11:38:57 +0000 (11:38 +0000)
commit953b134f2da8817898e9927b035445e40af0332b
tree17e67e6b7210e8eeb0f5eadf57696657a700e831
parentdfdc3791441ff6ede4b4ae36ecdc627561471a8e
[Magnifier-34] Keep magnifier inside its surface

Before this CL, the magnifier window was sometimes displayed partially
out of screen or overlapping with the system bar. This CL prevents this
issue by clamping the magnifier inside its parent surface, also taking
into account the system window insets of this surface.

Also, the CL fixes two kindof unrelated small bugs:
- remembers to reset the previous show and pixel copy coordinates on
  #dismiss()
- when clamping the pixel copy coordinates inside surface, consider the
  size of the copied content rather than the size of the window where
  this is scaled and then copied

Bug: 74234779
Test: atest CtsWidgetTestCases:android.widget.cts.MagnifierTest
Change-Id: Iec3404123145aa95b37c88f4fbfa3918cbf24f9d
core/java/android/widget/Magnifier.java