mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 15:26:58 +00:00
Merge "Use just the preview for drag and drop in the standalone activity" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
dcbd5e40c5
@@ -194,6 +194,11 @@ public class WidgetPickerActivity extends BaseActivity {
|
||||
return false;
|
||||
}
|
||||
|
||||
View dragView = widgetCell.getDragAndDropView();
|
||||
if (dragView == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ClipData clipData = new ClipData(
|
||||
new ClipDescription(
|
||||
/* label= */ "", // not displayed anywhere; so, set to empty.
|
||||
@@ -209,9 +214,9 @@ public class WidgetPickerActivity extends BaseActivity {
|
||||
.putExtra(EXTRA_IS_PENDING_WIDGET_DRAG, true));
|
||||
|
||||
// DRAG_FLAG_GLOBAL permits dragging data beyond app window.
|
||||
return view.startDragAndDrop(
|
||||
return dragView.startDragAndDrop(
|
||||
clipData,
|
||||
new View.DragShadowBuilder(view),
|
||||
new View.DragShadowBuilder(dragView),
|
||||
/* myLocalState= */ null,
|
||||
View.DRAG_FLAG_GLOBAL
|
||||
);
|
||||
|
||||
@@ -372,6 +372,13 @@ public class WidgetCell extends LinearLayout {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a view (holding the previews) that can be dragged and dropped.
|
||||
*/
|
||||
public View getDragAndDropView() {
|
||||
return mWidgetImageContainer;
|
||||
}
|
||||
|
||||
public WidgetImageView getWidgetView() {
|
||||
return mWidgetImage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user