Android Guides | Samples

Android.Graphics.Drawables.ScaleDrawable Class

A Drawable that changes the size of another Drawable based on its current level value.

See Also: ScaleDrawable

Syntax

[Android.Runtime.Register("android/graphics/drawable/ScaleDrawable", DoNotGenerateAcw=true)]
public class ScaleDrawable : Drawable, Drawable+ICallback, IDisposable

Remarks

A Drawable that changes the size of another Drawable based on its current level value. You can control how much the child Drawable changes in width and height based on the level, as well as a gravity to control where it is placed in its overall container. Most often used to implement things like progress bars.

It can be defined in an XML file with the <scale> element. For more information, see the guide to Drawable Resources.

[Android Documentation]

Requirements

Namespace: Android.Graphics.Drawables
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

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

See Also: Drawable

Public Constructors

Creates a new scale drawable with the specified gravity and scale properties.

Protected Constructors

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

Public Properties

[read-only]
DrawableDrawable. Returns the drawable scaled by this ScaleDrawable.
[read-only]
override
OpacityInt32. Return the opacity/transparency of this Drawable.

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

override
Draw(Canvas)
Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter).
InvalidateDrawable(Drawable)
Called when the drawable needs to be redrawn.
ScheduleDrawable(Drawable, IRunnable, Int64)
A Drawable can call this to schedule the next frame of its animation.
ScheduleDrawable(Drawable, Action, Int64)
override
SetAlpha(Int32)
Specify an alpha value for the drawable.
override
SetColorFilter(ColorFilter)
Specify an optional color filter for the drawable.
UnscheduleDrawable(Drawable, IRunnable)
A Drawable can call this to unschedule an action previously scheduled with Drawable+ICallback.
UnscheduleDrawable(Drawable, Action)