6

I'm using DragShadowBuilder for drag and drop but the moment I start the drag the view gets shaded with some alpha

I tried to set

View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);
shadowBuilder.getView().setAlpha(0);

but this sets the image not the shadowbuilder alpha. Ho can I remove the alpha?

SpyZip
  • 5,511
  • 4
  • 32
  • 53

1 Answers1

6

This is an old question but for just being an answer to this question: you can use DRAG_FLAG_OPAQUE flag for API 24(N) and beyond, for older versions you need a custom implementation or at least custom drawing in a container view: link

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
    shadowBuilder.view.startDragAndDrop(emptyData, shadowBuilder, this, DRAG_FLAG_OPAQUE)
}
Amir Khorsandi
  • 3,542
  • 1
  • 34
  • 38