summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/AppWidgetResizeFrame.java
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2016-11-21 16:18:46 -0800
committerJon Miranda <jonmiranda@google.com>2016-11-23 10:32:42 -0800
commit7ae64ffbe11a629e54ced0c5c99cd47228b28821 (patch)
tree4923ae2227ef72ba5e6ec5b9942496bf42fe1fd9 /src/com/android/launcher3/AppWidgetResizeFrame.java
parentfeba90fe802cb54e02dd961dbea265c044ad5f9e (diff)
downloadandroid_packages_apps_Trebuchet-7ae64ffbe11a629e54ced0c5c99cd47228b28821.tar.gz
android_packages_apps_Trebuchet-7ae64ffbe11a629e54ced0c5c99cd47228b28821.tar.bz2
android_packages_apps_Trebuchet-7ae64ffbe11a629e54ced0c5c99cd47228b28821.zip
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
Diffstat (limited to 'src/com/android/launcher3/AppWidgetResizeFrame.java')
-rw-r--r--src/com/android/launcher3/AppWidgetResizeFrame.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/launcher3/AppWidgetResizeFrame.java b/src/com/android/launcher3/AppWidgetResizeFrame.java
index 038092357..c45ff7b0c 100644
--- a/src/com/android/launcher3/AppWidgetResizeFrame.java
+++ b/src/com/android/launcher3/AppWidgetResizeFrame.java
@@ -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();