Prevent flicker when starting a drag.

Also, animate item the view to its new position when dragging.
This commit is contained in:
Patrick Dubroy
2010-11-23 14:40:33 -08:00
parent 2f5590d98e
commit a669d79d0d
11 changed files with 116 additions and 42 deletions

View File

@@ -320,6 +320,13 @@ public class DragController {
DragView dragView = mDragView = new DragView(mContext, b, registrationX, registrationY,
textureLeft, textureTop, textureWidth, textureHeight);
final DragSource dragSource = source;
dragView.setOnDrawRunnable(new Runnable() {
public void run() {
dragSource.onDragViewVisible();
};
});
if (dragRegion != null) {
dragView.setDragRegion(dragRegionLeft, dragRegion.top,
dragRegion.right - dragRegionLeft, dragRegion.bottom - dragRegionTop);