Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dcbd5e40 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Use just the preview for drag and drop in the standalone activity" into main

parents 671d4e53 277a4f9d
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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
            );
+7 −0
Original line number Diff line number Diff line
@@ -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;
    }