diff --git a/src/com/android/launcher3/views/OptionsPopupView.java b/src/com/android/launcher3/views/OptionsPopupView.java index 55febc7352..b62f60dc12 100644 --- a/src/com/android/launcher3/views/OptionsPopupView.java +++ b/src/com/android/launcher3/views/OptionsPopupView.java @@ -62,8 +62,10 @@ import java.util.List; /** * Popup shown on long pressing an empty space in launcher + * + * @param The context showing this popup. */ -public class OptionsPopupView extends ArrowPopup +public class OptionsPopupView extends ArrowPopup implements OnClickListener, OnLongClickListener { // An intent extra to indicate the horizontal scroll of the wallpaper. @@ -155,21 +157,27 @@ public class OptionsPopupView extends ArrowPopup } } - public static OptionsPopupView show(ActivityContext launcher, RectF targetRect, - List items, boolean shouldAddArrow) { - return show(launcher, targetRect, items, shouldAddArrow, 0 /* width */); + public static OptionsPopupView show( + ActivityContext activityContext, + RectF targetRect, + List items, + boolean shouldAddArrow) { + return show(activityContext, targetRect, items, shouldAddArrow, 0 /* width */); } - public static OptionsPopupView show(ActivityContext launcher, RectF targetRect, - List items, boolean shouldAddArrow, int width) { - OptionsPopupView popup = (OptionsPopupView) launcher.getLayoutInflater() - .inflate(R.layout.longpress_options_menu, launcher.getDragLayer(), false); + public static OptionsPopupView show( + ActivityContext activityContext, + RectF targetRect, + List items, + boolean shouldAddArrow, + int width) { + OptionsPopupView popup = (OptionsPopupView) activityContext.getLayoutInflater() + .inflate(R.layout.longpress_options_menu, activityContext.getDragLayer(), false); popup.mTargetRect = targetRect; popup.setShouldAddArrow(shouldAddArrow); for (OptionItem item : items) { - DeepShortcutView view = - (DeepShortcutView) popup.inflateAndAdd(R.layout.system_shortcut, popup); + DeepShortcutView view = popup.inflateAndAdd(R.layout.system_shortcut, popup); if (width > 0) { view.getLayoutParams().width = width; }