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

Commit 277a4f9d authored by Shamali P's avatar Shamali P Committed by Shamali Patwa
Browse files

Use just the preview for drag and drop in the standalone activity

Bug: N/A
Test: Manual
Flag: EXEMPT bugfix
Change-Id: I62c42b649e720826979123ae2ff6c5e238fe59dc
parent fc4ff35e
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;
    }