Scale widgets when dragging and dropping in multi-window mode.

This change mimics the non-MW mode behavior when dragging and
dropping widgets by taking the app widget scale into consideration.
This ensures a consistant drag and drop experience between
MW mode and non-MW mode.

* Uses cell data (cell height/width, spanX/Y) to get the expected
widget sizes.
* Scales sizes when necessary.

Bug: 32176631
Change-Id: Icdaf73ecd89a30e57fe7f405292d793f2d6a3ee8
This commit is contained in:
Jon Miranda
2016-12-05 12:04:44 -08:00
parent 4633be64e8
commit f7ff3fe58a
3 changed files with 57 additions and 18 deletions

View File

@@ -1041,7 +1041,7 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
// Offsets due to the size difference between the View and the dragOutline.
// There is a size difference to account for the outer blur, which may lie
// outside the bounds of the view.
top += (v.getHeight() - dragOutline.getHeight()) / 2;
top += ((mCellHeight * spanY) - dragOutline.getHeight()) / 2;
// We center about the x axis
left += ((mCellWidth * spanX) - dragOutline.getWidth()) / 2;
} else {