summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/AppWidgetResizeFrame.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher2/AppWidgetResizeFrame.java')
-rw-r--r--src/com/android/launcher2/AppWidgetResizeFrame.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher2/AppWidgetResizeFrame.java b/src/com/android/launcher2/AppWidgetResizeFrame.java
index c7dbc0f77..476219374 100644
--- a/src/com/android/launcher2/AppWidgetResizeFrame.java
+++ b/src/com/android/launcher2/AppWidgetResizeFrame.java
@@ -64,11 +64,13 @@ public class AppWidgetResizeFrame extends FrameLayout {
public static final int RIGHT = 2;
public static final int BOTTOM = 3;
+ private Launcher mLauncher;
+
public AppWidgetResizeFrame(Context context, ItemInfo itemInfo,
LauncherAppWidgetHostView widgetView, CellLayout cellLayout, DragLayer dragLayer) {
super(context);
- mContext = context;
+ mLauncher = (Launcher) context;
mItemInfo = itemInfo;
mCellLayout = cellLayout;
mWidgetView = widgetView;
@@ -77,7 +79,7 @@ public class AppWidgetResizeFrame extends FrameLayout {
mWorkspace = (Workspace) dragLayer.findViewById(R.id.workspace);
final AppWidgetProviderInfo info = widgetView.getAppWidgetInfo();
- int[] result = mCellLayout.rectToCell(info.minResizeWidth, info.minResizeHeight, null);
+ int[] result = mLauncher.getMinResizeSpanForWidget(info, null);
mMinHSpan = result[0];
mMinVSpan = result[1];
@@ -123,7 +125,7 @@ public class AppWidgetResizeFrame extends FrameLayout {
mRightHandle.setVisibility(GONE);
}
- final float density = mContext.getResources().getDisplayMetrics().density;
+ final float density = mLauncher.getResources().getDisplayMetrics().density;
mBackgroundPadding = (int) Math.ceil(density * BACKGROUND_PADDING);
mTouchTargetWidth = 2 * mBackgroundPadding;
}