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