I would like to create a custom drag shadow that is different from the view being dragged (actually it is a modified version of the view being dragged).
I can pass a view to the View.DragShadowBuilder
constructor like so:
View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(myView);
Problem is any changes I make to myView
also affects the View being dragged (and this is because Views cannot be cloned). How do I clone a View?
Alternatively I can extend the View.DragShadowBuilder and draw my custom view with a Bitmap in the provided onDraw(Canvas canvas)
method. But I am having trouble generating a shadow at all in the first place (I am assuming this is a valid approach).
Conversely is it possible to make a custom drag shadow at all from a View attached to the screen ? Any pointers or a solution would be most helpful.
My searches so far haven't yielded any useful results: How to create a custom drag shadow? How to show custom DragShadow instead of ListViewFragment row?