Android Guides | Samples

Android.Util.TypedValue Class

Container for a dynamically typed data value.

See Also: TypedValue

Syntax

[Android.Runtime.Register("android/util/TypedValue", DoNotGenerateAcw=true)]
public class TypedValue : Object

Remarks

Container for a dynamically typed data value. Primarily used with Resources for holding resource values.

[Android Documentation]

Requirements

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

The members of Android.Util.TypedValue 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 Fields

const
DensityDefaultInt32 (0). If TypedValue.Density is equal to this value, then the density should be treated as the system's default density value: DisplayMetrics.DensityDefault.
const
DensityNoneInt32 (65535). If TypedValue.Density is equal to this value, then there is no density associated with the resource and it should not be scaled.

Public Properties

AssetCookieInt32. Additional information about where the value came from; only set for strings.
ChangingConfigurationsConfigChanges. If Value came from a resource, these are the configurations for which its contents can change.
DataInt32. Basic data in the value, interpreted according to TypedValue.Type
DensityInt32. If the Value came from a resource, this holds the corresponding pixel density.
[read-only]
FloatSingle. Return the data for this value as a float.
ResourceIdInt32. If Value came from a resource, this holds the corresponding resource id.
StringICharSequence. If the value holds a string, this is it.
TypeDataType. The type held by this value, as defined by the constants here.

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

static
ApplyDimension(ComplexUnitType, Single, DisplayMetrics) : Single
Converts an unpacked complex data value holding a dimension to its final floating point value.
CoerceToString() : String
Perform type conversion as per TypedValue.CoerceToStringFormatted on an explicitly supplied type and data.
static
CoerceToString(DataType, Int32) : String
Perform type conversion as per TypedValue.CoerceToStringFormatted on an explicitly supplied type and data.
CoerceToStringFormatted() : ICharSequence
Regardless of the actual type of the value, try to convert it to a string value.
static
ComplexToDimension(Int32, DisplayMetrics) : Single
Converts a complex data value holding a dimension to its final floating point value.
static
ComplexToDimensionNoisy(Int32, DisplayMetrics) : Single
static
ComplexToDimensionPixelOffset(Int32, DisplayMetrics) : Int32
Converts a complex data value holding a dimension to its final value as an integer pixel offset.
static
ComplexToDimensionPixelSize(Int32, DisplayMetrics) : Int32
Converts a complex data value holding a dimension to its final value as an integer pixel size.
static
ComplexToFloat(Int32) : Single
Retrieve the base value from a complex data integer.
static
ComplexToFraction(Int32, Single, Single) : Single
Converts a complex data value holding a fraction to its final floating point value.
GetDimension(DisplayMetrics) : Single
Return the data for this value as a dimension.
GetFraction(Single, Single) : Single
Return the data for this value as a fraction.
SetTo(TypedValue)