Widget Picker: Update the launcher integration to support shortcuts

Updates drag and drop, tap to add and preview related code.

Bug: 370950552
Flag: com.android.launcher3.enable_widget_picker_refactor
Test: Drag and drop shortcuts on home screen
Change-Id: Iccfe329296dbf4b0770628e77df5cd9b42ac9b21
This commit is contained in:
shamalip committed 2025-06-08 20:40:21 +00:00
1 parent d885e21660
commit 077234aff5
7 files changed
+197 -148

No files matched your search

@@ -51,7 +51,6 @@ import com.android.launcher3.pm.ShortcutConfigActivityInfo;
import com.android.launcher3.util.CancellableTask;
import com.android.launcher3.util.Executors;
import com.android.launcher3.util.LooperExecutor;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.widget.util.WidgetSizes;
import java.util.concurrent.ExecutionException;
@@ -272,8 +271,7 @@ public class DatabaseWidgetPreviewLoader {
private Bitmap generateShortcutPreview(
ShortcutConfigActivityInfo info, int maxWidth, int maxHeight) {
int iconSize = ActivityContext.lookupContext(
mContext).getDeviceProfile().getAllAppsProfile().getIconSizePx();
int iconSize = mDeviceProfile.getAllAppsProfile().getIconSizePx();
int padding = mContext.getResources()
.getDimensionPixelSize(R.dimen.widget_preview_shortcut_padding);