diff --git a/res/layout/system_shortcut.xml b/res/layout/system_shortcut.xml
index de091c51c7..89895e54e4 100644
--- a/res/layout/system_shortcut.xml
+++ b/res/layout/system_shortcut.xml
@@ -16,36 +16,12 @@
-
-
-
+
diff --git a/res/layout/system_shortcut_content.xml b/res/layout/system_shortcut_content.xml
new file mode 100644
index 0000000000..8b39202f31
--- /dev/null
+++ b/res/layout/system_shortcut_content.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 07c211353f..8249887d9c 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -80,6 +80,7 @@ import android.content.res.Configuration;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Bitmap;
import android.graphics.Rect;
+import android.graphics.RectF;
import android.os.Build;
import android.os.Bundle;
import android.os.CancellationSignal;
@@ -2870,13 +2871,26 @@ public class Launcher extends StatefulActivity implements Launche
if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
Log.d(TestProtocol.PERMANENT_DIAG_TAG, "Opening options popup on key up");
}
- OptionsPopupView.showDefaultOptions(this, -1, -1);
+ showDefaultOptions(-1, -1);
}
return true;
}
return super.onKeyUp(keyCode, event);
}
+ /**
+ * Shows the default options popup
+ */
+ public void showDefaultOptions(float x, float y) {
+ float halfSize = getResources().getDimension(R.dimen.options_menu_thumb_size) / 2;
+ if (x < 0 || y < 0) {
+ x = mDragLayer.getWidth() / 2;
+ y = mDragLayer.getHeight() / 2;
+ }
+ RectF target = new RectF(x - halfSize, y - halfSize, x + halfSize, y + halfSize);
+ OptionsPopupView.show(this, target, OptionsPopupView.getOptions(this), false);
+ }
+
@Override
protected void collectStateHandlers(List out) {
out.add(getAllAppsController());
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index 33ee95162a..da701a8cb1 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -255,6 +255,10 @@ public final class FeatureFlags {
"WIDGETS_IN_LAUNCHER_PREVIEW", true,
"Enables widgets in Launcher preview for the Wallpaper app.");
+ public static final BooleanFlag QUICK_WALLPAPER_PICKER = getDebugFlag(
+ "QUICK_WALLPAPER_PICKER", false,
+ "Shows quick wallpaper picker in long-press menu");
+
public static void initialize(Context context) {
synchronized (sDebugFlags) {
for (DebugFlag flag : sDebugFlags) {
diff --git a/src/com/android/launcher3/touch/WorkspaceTouchListener.java b/src/com/android/launcher3/touch/WorkspaceTouchListener.java
index 4fa658e7d5..20d2ad36a5 100644
--- a/src/com/android/launcher3/touch/WorkspaceTouchListener.java
+++ b/src/com/android/launcher3/touch/WorkspaceTouchListener.java
@@ -41,7 +41,6 @@ import com.android.launcher3.Workspace;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.TestProtocol;
-import com.android.launcher3.views.OptionsPopupView;
/**
* Helper class to handle touch on empty space in workspace and show options popup on long press
@@ -175,7 +174,7 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe
mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
mLauncher.getStatsLogManager().logger().log(LAUNCHER_WORKSPACE_LONGPRESS);
- OptionsPopupView.showDefaultOptions(mLauncher, mTouchDownPoint.x, mTouchDownPoint.y);
+ mLauncher.showDefaultOptions(mTouchDownPoint.x, mTouchDownPoint.y);
} else {
cancelLongPress();
}
diff --git a/src/com/android/launcher3/views/OptionsPopupView.java b/src/com/android/launcher3/views/OptionsPopupView.java
index ecdd206224..257b18fcfb 100644
--- a/src/com/android/launcher3/views/OptionsPopupView.java
+++ b/src/com/android/launcher3/views/OptionsPopupView.java
@@ -176,16 +176,6 @@ public class OptionsPopupView extends ArrowPopup
return launcher.findViewById(R.id.popup_container);
}
- public static void showDefaultOptions(Launcher launcher, float x, float y) {
- float halfSize = launcher.getResources().getDimension(R.dimen.options_menu_thumb_size) / 2;
- if (x < 0 || y < 0) {
- x = launcher.getDragLayer().getWidth() / 2;
- y = launcher.getDragLayer().getHeight() / 2;
- }
- RectF target = new RectF(x - halfSize, y - halfSize, x + halfSize, y + halfSize);
- show(launcher, target, getOptions(launcher), false);
- }
-
/**
* Returns the list of supported actions
*/