Merge "Scale widgets when dragging and dropping in multi-window mode." into ub-launcher3-master

This commit is contained in:
Jonathan Miranda
2016-12-08 18:43:17 +00:00
committed by Android (Google) Code Review
3 changed files with 57 additions and 18 deletions

View File

@@ -3461,14 +3461,14 @@ public class Workspace extends PagedView
mLauncher.getDragLayer().getDescendantCoordRelativeToSelf(layout, loc, true);
resetTransitionTransform(layout);
float dragViewScaleX;
float dragViewScaleY;
float dragViewScaleX = 1f;
float dragViewScaleY = 1f;
if (scale) {
dragViewScaleX = (1.0f * r.width()) / dragView.getMeasuredWidth();
dragViewScaleY = (1.0f * r.height()) / dragView.getMeasuredHeight();
} else {
dragViewScaleX = 1f;
dragViewScaleY = 1f;
float width = info.spanX * layout.mCellWidth;
float height = info.spanY * layout.mCellHeight;
dragViewScaleX = r.width() / width;
dragViewScaleY = r.height() / height;
}
// The animation will scale the dragView about its center, so we need to center about