Android Guides | Samples

Android.Content.Res.Resources.Theme Class

This class holds the current attribute values for a particular theme.

See Also: Resources+Theme

Syntax

[Android.Runtime.Register("android/content/res/Resources$Theme", DoNotGenerateAcw=true)]
public sealed class Resources.Theme : Object

Remarks

This class holds the current attribute values for a particular theme. In other words, a Theme is a set of values for resource attributes; these are used in conjunction with TypedArray to resolve the final value for an attribute.

The Theme's attributes come into play in two ways: (1) a styled attribute can explicit reference a value in the theme through the "?themeAttribute" syntax; (2) if no value has been defined for a particular styled attribute, as a last resort we will try to find that attribute's value in the Theme.

You will normally use the Resources+Theme.ObtainStyledAttributes(IAttributeSet,Int32[],Int32[],Int32[]) APIs to retrieve XML attributes with style and theme information applied.

[Android Documentation]

Requirements

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

The members of Android.Content.Res.Resources.Theme are listed below.

See Also: Object

Public Properties

[read-only]
ResourcesResources.

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

ApplyStyle(Int32, Boolean)
Place new attribute values into the theme.
Dump(LogPriority, String, String)
Print contents of this theme out to the log.
GetDrawable(Int32) : Drawable
ObtainStyledAttributes(Int32[]) : TypedArray
Return a TypedArray holding the values defined by Theme which are listed in attrs.
ObtainStyledAttributes(Int32, Int32[]) : TypedArray
Return a TypedArray holding the values defined by the style resource resid which are listed in attrs.
ObtainStyledAttributes(IAttributeSet, Int32[], Int32, Int32) : TypedArray
Return a TypedArray holding the attribute values in set that are listed in attrs.
ResolveAttribute(Int32, TypedValue, Boolean) : Boolean
Retrieve the value of an attribute in the Theme.
SetTo(Resources+Theme)
Set this theme to hold the same contents as the theme other.