mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
Render preview layout in full widgets sheet and bottom widgets sheet
Video: https://drive.google.com/file/d/1gRE0axaq6tm3R_gjSon0RR5lC8HCmwee/view?usp=sharing Test: Install a sample app which provides a preview layout. Go to full widgets sheet to observe widget previews are correctly displayed for bitmap previews, layout previews and placeholder previews. Repeat the same for bottom widgets picker. Pin a widget from a sample app which provide a custom RemoteViews preview, observe the custom RemoteViews is correctly rendered. Bug: 179797520 Change-Id: I2ccd1f77b54a2430d842ee25349fa6e54b9159dc
This commit is contained in:
@@ -30,6 +30,7 @@ import com.android.launcher3.DropTarget.DragObject;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.dragndrop.DragOptions;
|
||||
import com.android.launcher3.dragndrop.LivePreviewWidgetCell;
|
||||
import com.android.launcher3.popup.PopupDataProvider;
|
||||
import com.android.launcher3.testing.TestLogging;
|
||||
import com.android.launcher3.testing.TestProtocol;
|
||||
@@ -99,12 +100,16 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView
|
||||
return false;
|
||||
}
|
||||
|
||||
PendingItemDragHelper dragHelper = new PendingItemDragHelper(v);
|
||||
if (v instanceof LivePreviewWidgetCell) {
|
||||
dragHelper.setPreview(((LivePreviewWidgetCell) v).getPreview());
|
||||
}
|
||||
|
||||
int[] loc = new int[2];
|
||||
getPopupContainer().getLocationInDragLayer(image, loc);
|
||||
|
||||
new PendingItemDragHelper(v).startDrag(
|
||||
image.getBitmapBounds(), image.getBitmap().getWidth(), image.getWidth(),
|
||||
new Point(loc[0], loc[1]), this, new DragOptions());
|
||||
dragHelper.startDrag(image.getBitmapBounds(), image.getBitmap().getWidth(),
|
||||
image.getWidth(), new Point(loc[0], loc[1]), this, new DragOptions());
|
||||
close(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user