다음을 통해 공유


RippleDrawable Class

Definition

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

[Android.Runtime.Register("android/graphics/drawable/RippleDrawable", DoNotGenerateAcw=true)]
public class RippleDrawable : Android.Graphics.Drawables.LayerDrawable
[<Android.Runtime.Register("android/graphics/drawable/RippleDrawable", DoNotGenerateAcw=true)>]
type RippleDrawable = class
    inherit LayerDrawable
Inheritance
Attributes

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 #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 android.R.id#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, ...).

<code>&lt;!-- A red ripple masked against an opaque rectangle. -->
            &lt;ripple android:color="#ffff0000">
              &lt;item android:id="@android:id/mask"
                    android:drawable="@android:color/white" />
            &lt;/ripple></code>

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.

<code>&lt;!-- A green ripple drawn atop a black rectangle. -->
            &lt;ripple android:color="#ff00ff00">
              &lt;item android:drawable="@android:color/black" />
            &lt;/ripple>

            &lt;!-- A blue ripple drawn atop a drawable resource. -->
            &lt;ripple android:color="#ff0000ff">
              &lt;item android:drawable="@drawable/my_drawable" />
            &lt;/ripple></code>

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.

<code>&lt;!-- An unbounded red ripple. -->
            &lt;ripple android:color="#ffff0000" /></code>

Java documentation for android.graphics.drawable.RippleDrawable.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

RippleDrawable(ColorStateList, Drawable, Drawable)

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

RippleDrawable(IntPtr, JniHandleOwnership)

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

Fields

InsetUndefined

Value used for undefined start and end insets.

(Inherited from LayerDrawable)
PaddingModeNest
Obsolete.

Padding mode used to nest each layer inside the padding of the previous layer.

(Inherited from LayerDrawable)
PaddingModeStack
Obsolete.

Padding mode used to stack each layer directly atop the previous layer.

(Inherited from LayerDrawable)
RadiusAuto

Radius value that specifies the ripple radius should be computed based on the size of the ripple's container.

Properties

Alpha

Gets the current alpha value for the drawable.

(Inherited from Drawable)
AutoMirrored

Tells if this Drawable will be automatically mirrored when its layout direction is RTL right-to-left. -or- Set whether this Drawable is automatically mirrored when its layout direction is RTL (right-to left).

(Inherited from Drawable)
BottomPadding

Returns the bottom padding in pixels.

(Inherited from LayerDrawable)
Bounds

Return the drawable's bounds Rect. -or- Specify a bounding rectangle for the Drawable.

(Inherited from Drawable)
Callback

Return the current Callback implementation attached to this Drawable.

(Inherited from Drawable)
ChangingConfigurations

Return a mask of the configuration parameters for which this drawable may change, requiring that it be re-created. -or- Set a mask of the configuration parameters for which this drawable may change, requiring that it be re-created.

(Inherited from Drawable)
Class

Returns the runtime class of this Object.

(Inherited from Object)
ColorFilter

Returns the current color filter, or null if none set.

(Inherited from Drawable)
Current (Inherited from Drawable)
DirtyBounds

Return the drawable's dirty bounds Rect.

(Inherited from Drawable)
EffectColor

Sets the ripple effect color.

EndPadding

Returns the end padding in pixels.

(Inherited from LayerDrawable)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
HasFocusStateSpecified

Indicates whether this drawable has at least one state spec explicitly specifying android.R.attr#state_focused.

(Inherited from Drawable)
IntrinsicHeight

Returns the drawable's intrinsic height.

(Inherited from Drawable)
IntrinsicWidth

Returns the drawable's intrinsic width.

(Inherited from Drawable)
IsFilterBitmap (Inherited from Drawable)
IsProjected

Whether this drawable requests projection.

(Inherited from Drawable)
IsStateful

Indicates whether this drawable will change its appearance based on state.

(Inherited from Drawable)
IsVisible (Inherited from Drawable)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
LayoutDirection

Returns the resolved layout direction for this Drawable.

(Inherited from Drawable)
LeftPadding

Returns the left padding in pixels.

(Inherited from LayerDrawable)
Level

Retrieve the current level.

(Inherited from Drawable)
MinimumHeight

Returns the minimum height suggested by this Drawable.

(Inherited from Drawable)
MinimumWidth

Returns the minimum width suggested by this Drawable.

(Inherited from Drawable)
NumberOfLayers

Returns the number of layers contained within this layer drawable.

(Inherited from LayerDrawable)
Opacity

Return the opacity/transparency of this Drawable.

(Inherited from LayerDrawable)
OpticalInsets

Return in insets the layout insets suggested by this Drawable for use with alignment operations during layout.

(Inherited from Drawable)
PaddingMode

Specifies how layer padding should affect the bounds of subsequent layers.

(Inherited from LayerDrawable)
PeerReference (Inherited from Object)
Radius

Sets the radius in pixels of the fully expanded ripple.

RightPadding

Returns the right padding in pixels.

(Inherited from LayerDrawable)
StartPadding

Returns the start padding in pixels.

(Inherited from LayerDrawable)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

TopPadding

Returns the top padding in pixels.

(Inherited from LayerDrawable)
TransparentRegion

Returns a Region representing the part of the Drawable that is completely transparent.

(Inherited from Drawable)

Methods

AddLayer(Drawable)

Adds a new layer containing the specified drawable to the end of the layer list and returns its index.

(Inherited from LayerDrawable)
ApplyTheme(Resources+Theme)

Applies the specified theme to this Drawable and its children.

(Inherited from Drawable)
CanApplyTheme() (Inherited from Drawable)
ClearColorFilter()

Removes the color filter for this drawable.

(Inherited from Drawable)
Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CopyBounds()

Return a copy of the drawable's bounds in a new Rect.

(Inherited from Drawable)
CopyBounds(Rect)

Return a copy of the drawable's bounds in the specified Rect (allocated by the caller).

(Inherited from Drawable)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Draw(Canvas)

Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter).

(Inherited from LayerDrawable)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
FindDrawableByLayerId(Int32)

Looks for a layer with the given ID and returns its Drawable.

(Inherited from LayerDrawable)
FindIndexByLayerId(Int32)

Returns the layer with the specified id.

(Inherited from LayerDrawable)
GetConstantState()

Return a ConstantState instance that holds the shared state of this Drawable.

(Inherited from Drawable)
GetDrawable(Int32)

Returns the drawable for the layer at the specified index.

(Inherited from LayerDrawable)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetHotspotBounds(Rect)

Populates outRect with the hotspot bounds.

(Inherited from Drawable)
GetId(Int32)

Returns the ID of the specified layer.

(Inherited from LayerDrawable)
GetLayerGravity(Int32) (Inherited from LayerDrawable)
GetLayerHeight(Int32) (Inherited from LayerDrawable)
GetLayerInsetBottom(Int32) (Inherited from LayerDrawable)
GetLayerInsetEnd(Int32) (Inherited from LayerDrawable)
GetLayerInsetLeft(Int32) (Inherited from LayerDrawable)
GetLayerInsetRight(Int32) (Inherited from LayerDrawable)
GetLayerInsetStart(Int32) (Inherited from LayerDrawable)
GetLayerInsetTop(Int32) (Inherited from LayerDrawable)
GetLayerWidth(Int32) (Inherited from LayerDrawable)
GetOutline(Outline)

Called to get the drawable to populate the Outline that defines its drawing area.

(Inherited from Drawable)
GetPadding(Rect)

Return in padding the insets suggested by this Drawable for placing content inside the drawable's bounds.

(Inherited from Drawable)
GetState()

Describes the current state, as a union of primitve states, such as android.R.attr#state_focused, android.R.attr#state_selected, etc.

(Inherited from Drawable)
Inflate(Resources, XmlReader, IAttributeSet, Resources+Theme)

Inflate this Drawable from an XML resource.

(Inherited from Drawable)
Inflate(Resources, XmlReader, IAttributeSet)

Inflate this Drawable from an XML resource.

(Inherited from Drawable)
InflateAsync(Resources, XmlReader, IAttributeSet, Resources+Theme) (Inherited from Drawable)
InflateAsync(Resources, XmlReader, IAttributeSet) (Inherited from Drawable)
InvalidateDrawable(Drawable)

Called when the drawable needs to be redrawn.

(Inherited from LayerDrawable)
InvalidateSelf()

Use the current Callback implementation to have this Drawable redrawn.

(Inherited from Drawable)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
JumpToCurrentState()

If this Drawable does transition animations between states, ask that it immediately jump to the current state and skip any active animations.

(Inherited from Drawable)
Mutate()

Make this drawable mutable.

(Inherited from Drawable)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
OnBoundsChange(Rect)

Override this in your subclass to change appearance if you vary based on the bounds.

(Inherited from Drawable)
OnLayoutDirectionChanged(Int32)

Called when the drawable's resolved layout direction changes.

(Inherited from Drawable)
OnLevelChange(Int32)

Override this in your subclass to change appearance if you vary based on level.

(Inherited from Drawable)
OnStateChange(Int32[])

Override this in your subclass to change appearance if you recognize the specified state.

(Inherited from Drawable)
ScheduleDrawable(Drawable, Action, Int64) (Inherited from LayerDrawable)
ScheduleDrawable(Drawable, IRunnable, Int64)

A Drawable can call this to schedule the next frame of its animation.

(Inherited from LayerDrawable)
ScheduleSelf(Action, Int64) (Inherited from Drawable)
ScheduleSelf(IRunnable, Int64)

Use the current Callback implementation to have this Drawable scheduled.

(Inherited from Drawable)
SetAlpha(Int32)

Specify an alpha value for the drawable. 0 means fully transparent, and 255 means fully opaque.

(Inherited from LayerDrawable)
SetBounds(Int32, Int32, Int32, Int32)

Specify a bounding rectangle for the Drawable.

(Inherited from Drawable)
SetCallback(Drawable+ICallback)

Bind a Callback object to this Drawable.

(Inherited from Drawable)
SetColor(ColorStateList)

Sets the ripple color.

SetColorFilter(Color, PorterDuff+Mode)

Specify a color and Porter-Duff mode to be the color filter for this drawable.

(Inherited from Drawable)
SetColorFilter(ColorFilter)

Specify an optional color filter for the drawable.

(Inherited from LayerDrawable)
SetDither(Boolean)

Set to true to have the drawable dither its colors when drawn to a device with fewer than 8-bits per color component.

(Inherited from Drawable)
SetDrawable(Int32, Drawable)

Sets the drawable for the layer at the specified index.

(Inherited from LayerDrawable)
SetDrawableByLayerId(Int32, Drawable)

Replaces the Drawable for the layer with the given id.

(Inherited from LayerDrawable)
SetFilterBitmap(Boolean)

Set to true to have the drawable filter its bitmaps with bilinear sampling when they are scaled or rotated.

(Inherited from Drawable)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetHotspot(Single, Single)

Specifies the hotspot's location within the drawable.

(Inherited from Drawable)
SetHotspotBounds(Int32, Int32, Int32, Int32)

Sets the bounds to which the hotspot is constrained, if they should be different from the drawable bounds.

(Inherited from Drawable)
SetId(Int32, Int32)

Sets the ID of a layer.

(Inherited from LayerDrawable)
SetLayerGravity(Int32, GravityFlags)

Sets the gravity used to position or stretch the specified layer within its container.

(Inherited from LayerDrawable)
SetLayerHeight(Int32, Int32) (Inherited from LayerDrawable)
SetLayerInset(Int32, Int32, Int32, Int32, Int32)

Specifies the insets in pixels for the drawable at the specified index.

(Inherited from LayerDrawable)
SetLayerInsetBottom(Int32, Int32) (Inherited from LayerDrawable)
SetLayerInsetEnd(Int32, Int32) (Inherited from LayerDrawable)
SetLayerInsetLeft(Int32, Int32) (Inherited from LayerDrawable)
SetLayerInsetRelative(Int32, Int32, Int32, Int32, Int32)

Specifies the relative insets in pixels for the drawable at the specified index.

(Inherited from LayerDrawable)
SetLayerInsetRight(Int32, Int32) (Inherited from LayerDrawable)
SetLayerInsetStart(Int32, Int32) (Inherited from LayerDrawable)
SetLayerInsetTop(Int32, Int32) (Inherited from LayerDrawable)
SetLayerSize(Int32, Int32, Int32)

Sets an explicit size for the specified layer.

(Inherited from LayerDrawable)
SetLayerWidth(Int32, Int32) (Inherited from LayerDrawable)
SetLayoutDirection(LayoutDirection)

Set the layout direction for this drawable.

(Inherited from Drawable)
SetLevel(Int32)

Specify the level for the drawable.

(Inherited from Drawable)
SetOpacity(Int32)

Sets the opacity of this drawable directly instead of collecting the states from the layers.

(Inherited from LayerDrawable)
SetPadding(Int32, Int32, Int32, Int32)

Sets the absolute padding.

(Inherited from LayerDrawable)
SetPaddingRelative(Int32, Int32, Int32, Int32)

Sets the relative padding.

(Inherited from LayerDrawable)
SetState(Int32[])

Specify a set of states for the drawable.

(Inherited from Drawable)
SetTint(Int32)

Specifies tint color for this drawable.

(Inherited from Drawable)
SetTintBlendMode(BlendMode)

Specifies a tint blending mode for this drawable.

(Inherited from Drawable)
SetTintList(ColorStateList)

Specifies tint color for this drawable as a color state list.

(Inherited from Drawable)
SetTintMode(PorterDuff+Mode)

Specifies a tint blending mode for this drawable.

(Inherited from Drawable)
SetVisible(Boolean, Boolean)

Set whether this Drawable is visible.

(Inherited from Drawable)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
UnscheduleDrawable(Drawable, Action) (Inherited from LayerDrawable)
UnscheduleDrawable(Drawable, IRunnable)

A Drawable can call this to unschedule an action previously scheduled with Drawable.ICallback.

(Inherited from LayerDrawable)
UnscheduleSelf(Action) (Inherited from Drawable)
UnscheduleSelf(IRunnable)

Use the current Callback implementation to have this Drawable unscheduled.

(Inherited from Drawable)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to