Prevent flicker when starting a drag.
Also, animate item the view to its new position when dragging.
This commit is contained in:
@@ -1360,7 +1360,6 @@ public class Workspace extends SmoothPagedView
|
||||
CellLayout current = getCurrentDropLayout();
|
||||
|
||||
current.onDragChild(child);
|
||||
child.setVisibility(View.GONE);
|
||||
|
||||
child.clearFocus();
|
||||
child.setPressed(false);
|
||||
@@ -1406,8 +1405,8 @@ public class Workspace extends SmoothPagedView
|
||||
// Based on the position of the drag view, find the top left of the original view
|
||||
int viewX = dragViewX + (dragView.getWidth() - child.getWidth()) / 2;
|
||||
int viewY = dragViewY + (dragView.getHeight() - child.getHeight()) / 2;
|
||||
viewX -= getResources().getInteger(R.integer.config_dragViewOffsetX);
|
||||
viewY -= getResources().getInteger(R.integer.config_dragViewOffsetY);
|
||||
viewX += getResources().getInteger(R.integer.config_dragViewOffsetX);
|
||||
viewY += getResources().getInteger(R.integer.config_dragViewOffsetY);
|
||||
|
||||
// Set its old pos (in the new parent's coordinates); it will be animated
|
||||
// in animateViewIntoPosition after the next layout pass
|
||||
@@ -2176,6 +2175,11 @@ public class Workspace extends SmoothPagedView
|
||||
mDragInfo = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDragViewVisible() {
|
||||
((View) mDragInfo.cell).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public boolean isDropEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user