Android Guides | Samples

Android.Graphics.Drawables.Drawable.ConstantState Class

This abstract class is used by Drawables to store shared constant state and data between Drawables.

See Also: Drawable+ConstantState

Syntax

[Android.Runtime.Register("android/graphics/drawable/Drawable$ConstantState", DoNotGenerateAcw=true)]
public abstract class Drawable.ConstantState : Object

Remarks

This abstract class is used by Drawables to store shared constant state and data between Drawables. BitmapDrawables created from the same resource will for instance share a unique bitmap stored in their ConstantState. Use Drawable.GetConstantState to retrieve the ConstantState of a Drawable. Calling Drawable.Mutate on a Drawable should typically create a new ConstantState for that Drawable.

Drawable+ConstantState.NewDrawable(Resources) can be used as a factory to create new Drawable instances from this ConstantState.

[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.Drawable.ConstantState are listed below.

See Also: Object

Public Constructors

Protected Constructors

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

Public Properties

[read-only]
abstract
ChangingConfigurationsConfigChanges. Return a bit mask of configuration changes that will impact this drawable (and thus require completely reloading it).

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

CanApplyTheme() : Boolean
abstract
NewDrawable() : Drawable
Create a new drawable without supplying resources the caller is running in.
NewDrawable(Resources) : Drawable
Create a new Drawable instance from its constant state.
NewDrawable(Resources, Resources+Theme) : Drawable