0

I am using a Drag and Drop event, and I want to change the drag shadow's opacity. I extended View.DragShadowBuilder class but I'm not able to set drag shadow's opacity. By default, it's semi transparent. I want it to look solid with no transparency. I do this:

    @Override
    public void onDrawShadow(Canvas canvas) {
        ImageView ivPiece = (ImageView) getView();
        BitmapDrawable drawable = (BitmapDrawable) ivPiece.getDrawable();
        Bitmap piece = drawable.getBitmap();
        Paint paint = new Paint();
        paint.setAlpha(255);
        paint.setAntiAlias(true);
        canvas.drawBitmap(piece, 0, 0, paint);
    }

But it doesn't work.

nope
  • 751
  • 2
  • 12
  • 29

1 Answers1

1

It appears that this isn't possible directly. However, an answer to a similar question gives a work-around, using a drag container. Hopefully that is helpful to you!

Community
  • 1
  • 1
John Nimis
  • 586
  • 3
  • 15