public static class View.DragShadowBuilder extends Object
onDrawShadow()are not overriden, then the default is an invisible drag shadow.
You are not required to use the View you provide to the constructor as the basis of the
drag shadow. The
onDrawShadow() method allows you to draw
anything you want as the drag shadow.
You pass a DragShadowBuilder object to the system when you start the drag. The system
onProvideShadowMetrics() to get the
size and position of the drag shadow. It uses this data to construct a
Canvas object, then it calls
so that your application can draw the shadow image in the Canvas.
For a guide to implementing drag and drop features, read the Drag and Drop developer guide.
|Constructor and Description|
Construct a shadow builder object with no associated View.
Constructs a shadow image builder based on a View.
|Modifier and Type||Method and Description|
Returns the View object that had been passed to the
Draws the shadow image.
Provides the metrics for the shadow image.
public View.DragShadowBuilder(View view)
view- A View. Any View in scope can be used.
onDrawShadow(Canvas)methods are also overridden in order to supply the drag shadow's dimensions and appearance without reference to any View object. If they are not overridden, then the result is an invisible drag shadow.
public final View getView()
View.DragShadowBuilder(View)constructor. If that View parameter was
nullor if the
View.DragShadowBuilder()constructor was used to instantiate the builder object, this method will return null.
The default implementation sets the dimensions of the shadow to be the same as the dimensions of the View itself and centers the shadow under the touch point.
Pointcontaining the width and height of the shadow image. Your application must set
Point.xto the desired width and must set
Point.yto the desired height of the image.
Pointfor the position within the shadow image that should be underneath the touch point during the drag and drop operation. Your application must set
Point.xto the X coordinate and
Point.yto the Y coordinate of this position.