mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
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:
@@ -3467,14 +3467,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
|
||||
|
||||
Reference in New Issue
Block a user