Scale widgets in multi-window mode.

To keep this CL small and focused, I'm going to create
a separate CL that handles the scaling for the widget in
drag and drop mode.

Bug: 32176631
Change-Id: Id6557d070edb664aa1f4851de7abf494cf8a0677
This commit is contained in:
Jon Miranda
2016-11-21 16:18:46 -08:00
parent feba90fe80
commit 7ae64ffbe1
4 changed files with 52 additions and 13 deletions

View File

@@ -355,10 +355,11 @@ public class AppWidgetResizeFrame extends FrameLayout
public void snapToWidget(boolean animate) {
final DragLayer.LayoutParams lp = (DragLayer.LayoutParams) getLayoutParams();
int newWidth = mWidgetView.getWidth() + 2 * mBackgroundPadding
- mWidgetPadding.left - mWidgetPadding.right;
int newHeight = mWidgetView.getHeight() + 2 * mBackgroundPadding
- mWidgetPadding.top - mWidgetPadding.bottom;
DeviceProfile profile = mLauncher.getDeviceProfile();
int newWidth = (int) (mWidgetView.getWidth() * profile.appWidgetScale.x)
+ 2 * mBackgroundPadding - mWidgetPadding.left - mWidgetPadding.right;
int newHeight = (int) (mWidgetView.getHeight() * profile.appWidgetScale.y)
+ 2 * mBackgroundPadding - mWidgetPadding.top - mWidgetPadding.bottom;
mTmpPt[0] = mWidgetView.getLeft();
mTmpPt[1] = mWidgetView.getTop();