OSDN Git Service

Stop jumping to workspace from hotseat on quick drop.
authorTony Wickham <twickham@google.com>
Tue, 13 Sep 2016 01:09:33 +0000 (18:09 -0700)
committerTony Wickham <twickham@google.com>
Tue, 20 Sep 2016 23:48:42 +0000 (16:48 -0700)
commitdbf08b4aee0bd9c296552485a34f15f997a56f3f
treeb8d749dbcd7f6f8f5a29012536e73e80c1bc383e
parent41253866876bc3cbb7d52cd0f28063cea7aca59d
Stop jumping to workspace from hotseat on quick drop.

Regression occurred in ag/1315317.

In that change, Launcher#enterSpringLoadedDragMode() was moved from
the end of startDrag() to the end of onDragStart(). This changed the
sequence of events from:

beginDragShared() --> DragController#startDrag() --> onDragStart -->
dropTarget.onDragOver() --> Launcher#enterSpringLoadedDragMode()

to:

beginDragShared() --> DragController#startDrag() --> onDragStart -->
Launcher#enterSpringLoadedDragMode() --> onDragOver()

Basically, the key difference is that onDragOver() is called after
enterSpringLoadedDragMode(). This matters, because onDragOver()
returns early if Workspace#transitionStateShouldAllowDrop() returns
false, which it does during the spring loaded transition. This meant
that onDragOver() didn't update the layout to be Hotseat, and thus
the current workspace page was used as default, since that is what
was set in onDragEnter(). To fix it, I've copied the logic in
onDragOver() that checks to see if the drag is over the hotseat first
to a new method that onDragEnter() now calls as well.

Bug: 31245181
Change-Id: Ie758921b25fc96516a09c32bdc9706da941522df
src/com/android/launcher3/Workspace.java