I have a requirement when the dragged view requires that the shadow is initially placed directly above the view, that is, it covers the entire view, and not the point of touch.
I tried all kinds to make this work with my subclass of View.DragShadowBuilder , but no luck. I was hoping that using drawRect would allow me to specify the points of the rectangle so that it was drawn in the same rectangle as my view, but that would not cause the canvas to not be drawn.
However, using canvas.drawColor(Color.CYAN) draws a rectangle, but relative to the point of touch.
Here is my attempt using drawRect :
private class VideoDragShadowBuilder extends View.DragShadowBuilder { public VideoDragShadowBuilder(View v) { super(v); } @Override public void onProvideShadowMetrics (Point size, Point touch) { int width, height; width = getView().getWidth(); height = getView().getHeight(); size.set(width, height); touch.set(width / 2, height / 2); } @Override public void onDrawShadow(Canvas canvas) {
Here, the blue rectangle is slightly biased with the image below due to where I touched - I want it to completely overlap the view no matter where the user touches.

source share