summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/widget/WidgetHostViewLoader.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/widget/WidgetHostViewLoader.java')
-rw-r--r--src/com/android/launcher3/widget/WidgetHostViewLoader.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/launcher3/widget/WidgetHostViewLoader.java b/src/com/android/launcher3/widget/WidgetHostViewLoader.java
index b47ba84fc..297505be2 100644
--- a/src/com/android/launcher3/widget/WidgetHostViewLoader.java
+++ b/src/com/android/launcher3/widget/WidgetHostViewLoader.java
@@ -151,15 +151,15 @@ public class WidgetHostViewLoader implements DragController.DragListener {
return true;
}
- public static Bundle getDefaultOptionsForWidget(Launcher launcher, PendingAddWidgetInfo info) {
+ public static Bundle getDefaultOptionsForWidget(Context context, PendingAddWidgetInfo info) {
Bundle options = null;
- Rect rect = new Rect();
if (Utilities.ATLEAST_JB_MR1) {
- AppWidgetResizeFrame.getWidgetSizeRanges(launcher, info.spanX, info.spanY, rect);
- Rect padding = AppWidgetHostView.getDefaultPaddingForWidget(launcher,
+ Rect rect = new Rect();
+ AppWidgetResizeFrame.getWidgetSizeRanges(context, info.spanX, info.spanY, rect);
+ Rect padding = AppWidgetHostView.getDefaultPaddingForWidget(context,
info.componentName, null);
- float density = launcher.getResources().getDisplayMetrics().density;
+ float density = context.getResources().getDisplayMetrics().density;
int xPaddingDips = (int) ((padding.left + padding.right) / density);
int yPaddingDips = (int) ((padding.top + padding.bottom) / density);