Merge "Fix 3099036: Drag visualization appears in wrong spot" into honeycomb
This commit is contained in:
committed by
Android (Google) Code Review
commit
1d8ad0dd3b
@@ -123,6 +123,14 @@ public class DragView extends View {
|
||||
// The point in our scaled bitmap that the touch events are located
|
||||
mRegistrationX = registrationX;
|
||||
mRegistrationY = registrationY;
|
||||
|
||||
// Force a measure, because Workspace uses getMeasuredHeight() before the layout pass
|
||||
int ms = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
|
||||
measure(ms, ms);
|
||||
}
|
||||
|
||||
public float getOffsetY() {
|
||||
return mOffsetY;
|
||||
}
|
||||
|
||||
public void setDragRegion(int left, int top, int width, int height) {
|
||||
|
||||
@@ -2259,6 +2259,13 @@ public class Workspace extends SmoothPagedView
|
||||
dragView.getDragRegionHeight());
|
||||
}
|
||||
}
|
||||
} else if (source == this) {
|
||||
// When dragging from the workspace, the drag view is slightly bigger than
|
||||
// the original view, and offset vertically. Adjust to account for this.
|
||||
final View origView = mDragInfo.cell;
|
||||
originX += (dragView.getMeasuredWidth() - origView.getWidth()) / 2;
|
||||
originY += (dragView.getMeasuredHeight() - origView.getHeight()) / 2
|
||||
+ dragView.getOffsetY();
|
||||
}
|
||||
|
||||
if (mDragTargetLayout != null) {
|
||||
|
||||
Reference in New Issue
Block a user