Is it possible to make a drag shadow opaque?

前端 未结 5 1047
粉色の甜心
粉色の甜心 2020-12-16 06:14

As question states. here is my dragshadowbuilder for reference. As you know, the shadow that is created when you drag is translucent. Is there anyway to make it opaque? (ful

5条回答
  •  时光取名叫无心
    2020-12-16 06:36

    Its not possible to achieve that. This is how startDragAndDrop is creating the surface to drag on:

    final SurfaceControl surfaceControl = new SurfaceControl.Builder(session)
                .setName("drag surface")
                .setParent(root.getSurfaceControl())
                .setBufferSize(shadowSize.x, shadowSize.y)
                .setFormat(PixelFormat.TRANSLUCENT)
                .setCallsite("View.startDragAndDrop")
                .build();
    

    As you can see, the format is set to PixelFormat.TRANSLUCENT, and no option to change that

提交回复
热议问题