Add support for system shortcuts in popup container
- Currently the system shortcuts are just widgets and app info
- As shortcuts, they live in ShortcutsItemView
- They are populated either as icons only (if there are deep
shortcuts) or as icons + text
- Widgets are disabled until binding them is complete (we request for
them to be bound on long-press now). We should revisit this.
Bug: 34940468
Change-Id: Ia51d002c3b3ede87658bdab57abfc3eeca1ed242
diff --git a/src/com/android/launcher3/WidgetPreviewLoader.java b/src/com/android/launcher3/WidgetPreviewLoader.java
index 0e91062..49e68d7 100644
--- a/src/com/android/launcher3/WidgetPreviewLoader.java
+++ b/src/com/android/launcher3/WidgetPreviewLoader.java
@@ -91,11 +91,12 @@
* @return a request id which can be used to cancel the request.
*/
public CancellationSignal getPreview(WidgetItem item, int previewWidth,
- int previewHeight, WidgetCell caller) {
+ int previewHeight, WidgetCell caller, boolean animate) {
String size = previewWidth + "x" + previewHeight;
WidgetCacheKey key = new WidgetCacheKey(item.componentName, item.user, size);
- PreviewLoadTask task = new PreviewLoadTask(key, item, previewWidth, previewHeight, caller);
+ PreviewLoadTask task = new PreviewLoadTask(key, item, previewWidth, previewHeight, caller,
+ animate);
task.executeOnExecutor(Utilities.THREAD_POOL_EXECUTOR);
CancellationSignal signal = new CancellationSignal();
@@ -521,17 +522,19 @@
private final int mPreviewHeight;
private final int mPreviewWidth;
private final WidgetCell mCaller;
+ private final boolean mAnimatePreviewIn;
private final BaseActivity mActivity;
@Thunk long[] mVersions;
@Thunk Bitmap mBitmapToRecycle;
PreviewLoadTask(WidgetCacheKey key, WidgetItem info, int previewWidth,
- int previewHeight, WidgetCell caller) {
+ int previewHeight, WidgetCell caller, boolean animate) {
mKey = key;
mInfo = info;
mPreviewHeight = previewHeight;
mPreviewWidth = previewWidth;
mCaller = caller;
+ mAnimatePreviewIn = animate;
mActivity = BaseActivity.fromContext(mCaller.getContext());
if (DEBUG) {
Log.d(TAG, String.format("%s, %s, %d, %d",
@@ -587,7 +590,7 @@
@Override
protected void onPostExecute(final Bitmap preview) {
- mCaller.applyPreview(preview);
+ mCaller.applyPreview(preview, mAnimatePreviewIn);
// Write the generated preview to the DB in the worker thread
if (mVersions != null) {