Make a transparent canvas opaque (attempt to override the drag-and-drop appearance of drag and drop in Android)

The default view and position for a shadow trend is a view of the past made transparent and focused on your touch. I want him to look solid, and the look begins with your touch.

I pulled down DragShadowBuilder and redid "onProvideShadowMetrics" and "onDrawShadow". I have positioning as I want, but I don't know how to turn off transparency.

Here is a touch listener with a call making my dragShadowBuilder and dragShadowBuilder class:

private OnTouchListener onTouchListener = new OnTouchListener() {

    @Override
    public boolean onTouch(View v, MotionEvent event) {
        if (event.getAction() == MotionEvent.ACTION_DOWN) {
            Item current = (Item) ((View) v.getTag()).getTag();
            //ClipData data = ClipData.newPlainText("test", "testText");
            View dragView = (View) v.getTag();//the on touch view is just the "grid" image.  It holds the whole view in it tag
            DragShadowBuilder shadowBuilder = new ItemDragShadowBuilder(dragView, 
                                new Point(v.getWidth()/2, v.getHeight()/2));
            v.startDrag(null, shadowBuilder, current, 0);
            dragView.setVisibility(View.INVISIBLE);
            return true;
        } else {
            return false;
        }       
    }

};

private static class ItemDragShadowBuilder extends View.DragShadowBuilder {

    private Point touchPoint = null;
    private Point sizePoint = null;
    private View dragView = null;

    public ItemDragShadowBuilder(View dragView, Point touchPoint) {
        super();
        sizePoint = new Point(dragView.getWidth(), dragView.getHeight());
        this.touchPoint = touchPoint;
        this.dragView = dragView;
    }

    @Override
    public void onProvideShadowMetrics (Point size, Point touch) {
        size.set(sizePoint.x, sizePoint.y);
        touch.set(touchPoint.x,touchPoint.y);
    }

    @Override
    public void onDrawShadow(Canvas canvas) {
        dragView.draw(canvas);
        //How do I change the transparency?
        //super.onDrawShadow(canvas);
    }



}

Here is my current drag and drop screen:

My current screen

. , , , Google Current , "re-order". , .

Google currents

?

+5

All Articles