Merge "Fix selecting with touch in multi-window." into nyc-dev am: fbd4b55

am: 8d17c6f

* commit '8d17c6f28fedf6de168d932614d5e50cb6fd35a7':
  Fix selecting with touch in multi-window.

Change-Id: I8ffb8b0bf84943b87d859250d737762d3415c618
This commit is contained in:
Tomasz Mikolajewski
2016-04-12 01:24:23 +00:00
committed by android-build-merger

View File

@@ -139,11 +139,13 @@ public abstract class DocumentHolder
}
// Do everything in global coordinates - it makes things simpler.
Rect rect = new Rect();
mSelectionHotspot.getGlobalVisibleRect(rect);
int[] coords = new int[2];
mSelectionHotspot.getLocationOnScreen(coords);
Rect rect = new Rect(coords[0], coords[1], coords[0] + mSelectionHotspot.getWidth(),
coords[1] + mSelectionHotspot.getHeight());
// If the tap occurred within the icon rect, consider it a selection.
if (rect.contains((int)event.getRawX(), (int)event.getRawY())) {
if (rect.contains((int) event.getRawX(), (int) event.getRawY())) {
return mEventListener.onSelect(this);
} else {
return mEventListener.onActivate(this);