TypedValue Class

Definition

Container for a dynamically typed data value.

[Android.Runtime.Register("android/util/TypedValue", DoNotGenerateAcw=true)]
public class TypedValue : Java.Lang.Object
[<Android.Runtime.Register("android/util/TypedValue", DoNotGenerateAcw=true)>]
type TypedValue = class
    inherit Object
Inheritance
TypedValue
Attributes

Remarks

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

Java documentation for android.util.TypedValue.

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

TypedValue()
TypedValue(IntPtr, JniHandleOwnership)

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

Fields

DataNullEmpty

#TYPE_NULL data indicating the value was explicitly set to null.

DataNullUndefined

#TYPE_NULL data indicating the value was not specified.

DensityDefault

If #density is equal to this value, then the density should be treated as the system's default density value: DisplayMetrics#DENSITY_DEFAULT.

DensityNone

If #density is equal to this value, then there is no density associated with the resource and it should not be scaled.

Properties

AssetCookie

Additional information about where the value came from; only set for strings.

ChangingConfigurations

If the value came from a resource, these are the configurations for which its contents can change.

Class

Returns the runtime class of this Object.

(Inherited from Object)
ComplexUnit

Return the complex unit type for this value.

Data

Basic data in the value, interpreted according to #type

Density

If the Value came from a resource, this holds the corresponding pixel density.

Float

Return the data for this value as a float.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsColorType

Determine if a value is a color.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ResourceId

If Value came from a resource, this holds the corresponding resource id.

SourceResourceId

If the Value came from a style resource or a layout resource (set in an XML layout), this holds the corresponding style or layout resource id against which the attribute was resolved.

String

If the value holds a string, this is it.

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.

Type

The type held by this value, as defined by the constants here.

Methods

ApplyDimension(ComplexUnitType, Single, DisplayMetrics)

Converts an unpacked complex data value holding a dimension to its final floating point pixel value.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CoerceToString()

Regardless of the actual type of the value, try to convert it to a string value.

CoerceToString(DataType, Int32)

Perform type conversion as per #coerceToString() on an explicitly supplied type and data.

CoerceToStringFormatted()

Regardless of the actual type of the value, try to convert it to a string value.

ComplexToDimension(Int32, DisplayMetrics)

Converts a complex data value holding a dimension to its final floating point value.

ComplexToDimensionNoisy(Int32, DisplayMetrics)
ComplexToDimensionPixelOffset(Int32, DisplayMetrics)

Converts a complex data value holding a dimension to its final value as an integer pixel offset.

ComplexToDimensionPixelSize(Int32, DisplayMetrics)

Converts a complex data value holding a dimension to its final value as an integer pixel size.

ComplexToFloat(Int32)

Retrieve the base value from a complex data integer.

ComplexToFraction(Int32, Single, Single)

Converts a complex data value holding a fraction to its final floating point value.

ConvertDimensionToPixels(ComplexUnitType, Single, DisplayMetrics)

Converts a dimension value to raw pixels, e.

ConvertPixelsToDimension(ComplexUnitType, Single, DisplayMetrics)

Converts a pixel value to the given dimension, e.

DeriveDimension(ComplexUnitType, Single, DisplayMetrics)

Converts a pixel value to the given dimension, e.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

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

(Inherited from Object)
GetDimension(DisplayMetrics)

Return the data for this value as a dimension.

GetFraction(Single, Single)

Return the data for this value as a fraction.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
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)
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)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetTo(TypedValue)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
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