Android Guides | Samples

Android.Graphics.Drawables.RippleDrawable Class

Drawable that shows a ripple effect in response to state changes.

See Also: RippleDrawable

Syntax

[Android.Runtime.Register("android/graphics/drawable/RippleDrawable", DoNotGenerateAcw=true)]
public class RippleDrawable : LayerDrawable

Remarks

Drawable that shows a ripple effect in response to state changes. The anchoring position of the ripple for a given state may be specified by calling RippleDrawable.setHotspot(float, float) with the corresponding state attribute identifier.

A touch feedback drawable may contain multiple child layers, including a special mask layer that is not drawn to the screen. A single layer may be set as the mask from XML by specifying its android:id value as NoType:android/R$id;Href=../../../../reference/android/R.id.html#mask. At run time, a single layer may be set as the mask using setId(..., android.R.id.mask) or an existing mask layer may be replaced using setDrawableByLayerId(android.R.id.mask, ...).

If a mask layer is set, the ripple effect will be masked against that layer before it is drawn over the composite of the remaining child layers.

If no mask layer is set, the ripple effect is masked against the composite of the child layers.

If no child layers or mask is specified and the ripple is set as a View background, the ripple will be drawn atop the first available parent background within the View's hierarchy. In this case, the drawing region may extend outside of the Drawable bounds.

[Android Documentation]

Requirements

Namespace: Android.Graphics.Drawables
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0

The members of Android.Graphics.Drawables.RippleDrawable are listed below.

See Also: LayerDrawable

Public Constructors

Creates a new ripple drawable with the specified ripple color and optional content and mask drawables.

Protected Constructors

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

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

SetColor(ColorStateList)
Sets the ripple color.