OSDN Git Service

Fix drag enter/exit reporting
authorChris Tate <ctate@google.com>
Tue, 2 Nov 2010 22:55:39 +0000 (15:55 -0700)
committerChris Tate <ctate@google.com>
Tue, 2 Nov 2010 22:55:39 +0000 (15:55 -0700)
commit9d1ab883293b047b654935b84d0803c8c383be91
treee41a26d0f18e08f033d880e4a3de5c1a75db417d
parent4b8d36b30ad2e87f3969034eb42dc14b99f03686
Fix drag enter/exit reporting

Now, each ViewGroup is tracking which of its child views [which might
themselves be ViewGroups] is currently under the drag point, and when the
drag leaves that child, a DRAG_EXITED is synthesized and dispatched all
the way down to the leaf view previously under the point.  ENTERED is
still *not* dispatched down like this; instead, it's calculated and
synthesized directly at each level based on the new LOCATION.

The ViewRoot still tracks the leaf drag target, but solely for the
purpose of reporting changes to the OS after full dispatch of a new
LOCATION -- the entered/exited messaging is no longer initiated at the
ViewRoot level.

Change-Id: I0089cc538b7e33a0440187543fcfd2f8b12e197d
core/java/android/view/ViewGroup.java
core/java/android/view/ViewRoot.java
services/java/com/android/server/WindowManagerService.java