Android Guides | Samples

Android.Views.View.DragShadowBuilder Class

Creates an image that the system displays during the drag and drop operation.

See Also: View+DragShadowBuilder

Syntax

[Android.Runtime.Register("android/view/View$DragShadowBuilder", DoNotGenerateAcw=true)]
public class View.DragShadowBuilder : Object

Remarks

Creates an image that the system displays during the drag and drop operation. This is called a "drag shadow". The default implementation for a DragShadowBuilder based on a View returns an image that has exactly the same appearance as the given View. The default also positions the center of the drag shadow directly under the touch point. If no View is provided (the constructor with no parameters is used), and View+DragShadowBuilder.OnProvideShadowMetrics(Point,Point) and View+DragShadowBuilder.OnDrawShadow(Canvas) are not overriden, then the default is an invisible drag shadow.

Developer Guides

You are not required to use the View you provide to the constructor as the basis of the drag shadow. The View+DragShadowBuilder.OnDrawShadow(Canvas) 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 calls View+DragShadowBuilder.OnProvideShadowMetrics(Point,Point) to get the size and position of the drag shadow. It uses this data to construct a Canvas object, then it calls View+DragShadowBuilder.OnDrawShadow(Canvas) 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.

[Android Documentation]

Requirements

Namespace: Android.Views
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 11

The members of Android.Views.View.DragShadowBuilder are listed below.

See Also: Object

Public Constructors

Construct a shadow builder object with no associated View.
Constructs a shadow image builder based on a View.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
ViewView. Returns the View object that had been passed to the View+DragShadowBuilder.DragShadowBuilder(View) constructor.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

OnDrawShadow(Canvas)
Draws the shadow image.
OnProvideShadowMetrics(Point, Point)
Provides the metrics for the shadow image.