diff options
author | Christopher Tate <ctate@google.com> | 2010-11-30 17:14:08 -0800 |
---|---|---|
committer | Christopher Tate <ctate@google.com> | 2010-12-01 14:45:06 -0800 |
commit | 407b4e91fe7627545b8110e683953353236b4543 (patch) | |
tree | 4235966903b57ba0faf502fc3a91e4f81aeef67b /packages | |
parent | 4da12f07b5c1ecd7cea7f44081a744523936bd41 (diff) | |
download | frameworks_base-407b4e91fe7627545b8110e683953353236b4543.zip frameworks_base-407b4e91fe7627545b8110e683953353236b4543.tar.gz frameworks_base-407b4e91fe7627545b8110e683953353236b4543.tar.bz2 |
API CHANGE: drags can now carry an originator-only object payload
When calling startDrag(), the app can now supply an Object to be passed
along in every DragEvent that the app winds up receiving itself. This
object is *not* passed to any other applications; it's strictly app-
local. The purpose is to allow state tracking/management to be done
directly through the drag mechanism rather than requiring out-of-band
code.
An example of the utility here might be TextEdit widgets. A drag that
starts in one TextEdit but ends in a different one should be treated as
a copy/paste operation, where the originating TextEdit is not altered.
However, a drag that starts and ends in the *same* TextEdit is a 'move'
operation within that TextEdit; the text is removed from its original
position and inserted at the drop point. To support this easily, the
drag/drop code in TextEdit can now pass a pointer to the originating
view as the local state object. Then, the drop recipient could tell
whether the drag started within the same TextEdit without needing to
implement any other out-of-band state tracking.
This CL (and its accompanying CLs in a few other packages where the
startDrag() API is being used) adds the new local-state parameter to
the API, but does not actually change the behavior of any existing
clients.
Change-Id: Icba73b2ab4a650b7a94485a19633065b0ef9058c
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java index d1e61a9..4d0835f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java @@ -169,7 +169,7 @@ public class ShirtPocket extends FrameLayout { thumb = new DragThumbnailBuilder(mWindow.findViewById(R.id.preview)); } - v.startDrag(clip, thumb, false); + v.startDrag(clip, thumb, false, null); // TODO: only discard the clipping if it was accepted stash(null); |