Android Guides | Samples

Android.Widget.EdgeEffect Class

This class performs the graphical effect used at the edges of scrollable widgets when the user scrolls beyond the content bounds in 2D space.

See Also: EdgeEffect

Syntax

[Android.Runtime.Register("android/widget/EdgeEffect", DoNotGenerateAcw=true)]
public class EdgeEffect : Object

Remarks

This class performs the graphical effect used at the edges of scrollable widgets when the user scrolls beyond the content bounds in 2D space.

EdgeEffect is stateful. Custom widgets using EdgeEffect should create an instance for each edge that should show the effect, feed it input data using the methods EdgeEffect.OnAbsorb(Int32), EdgeEffect.OnPull(Single), and EdgeEffect.OnRelease, and draw the effect using EdgeEffect.Draw(Canvas) in the widget's overridden View.Draw(Canvas) method. If EdgeEffect.IsFinished returns false after drawing, the edge effect's animation is not yet complete and the widget should schedule another drawing pass to continue the animation.

When drawing, widgets should draw their main content and child views first, usually by invoking super.draw(canvas) from an overridden draw method. (This will invoke onDraw and dispatch drawing to child views as needed.) The edge effect may then be drawn on top of the view's content using the EdgeEffect.Draw(Canvas) method.

[Android Documentation]

Requirements

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

The members of Android.Widget.EdgeEffect are listed below.

See Also: Object

Public Constructors

Construct a new EdgeEffect with a theme appropriate for the provided context.

Protected Constructors

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

Public Properties

ColorColor. Return the color of this edge effect in argb.
[read-only]
IsFinishedBoolean. Reports if this EdgeEffect's animation is finished.
[read-only]
MaxHeightInt32. Return the maximum height that the edge effect will be drawn at given the original EdgeEffect.SetSize(Int32,Int32).

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

Draw(Canvas) : Boolean
Draw into the provided canvas.
Finish()
Immediately finish the current animation.
OnAbsorb(Int32)
Call when the effect absorbs an impact at the given velocity.
OnPull(Single)
A view should call this when content is pulled away from an edge by the user.
OnPull(Single, Single)
A view should call this when content is pulled away from an edge by the user.
OnRelease()
Call when the object is released after being pulled.
SetSize(Int32, Int32)
Set the size of this edge effect in pixels.