TypedValue
open class TypedValue
| kotlin.Any | |
| ↳ | android.util.TypedValue |
Container for a dynamically typed data value. Primarily used with android.content.res.Resources for holding resource values.
Summary
| Constants | |
|---|---|
| static Int |
Complex data: mask to extract mantissa information (after shifting by |
| static Int |
Complex data: bit location of mantissa information. |
| static Int |
Complex data: the mantissa magnitude is 0 bits -- i. |
| static Int |
Complex data: the mantissa magnitude is 16 bits -- i. |
| static Int |
Complex data: the mantissa is an integral number -- i. |
| static Int |
Complex data: the mantissa magnitude is 8 bits -- i. |
| static Int |
Complex data: mask to extract radix information (after shifting by |
| static Int |
Complex data: where the radix information is, telling where the decimal place appears in the mantissa. |
| static Int |
|
| static Int |
|
| static Int |
|
| static Int |
|
| static Int |
Complex data: mask to extract unit information (after shifting by |
| static Int |
|
| static Int |
|
| static Int |
|
| static Int |
Complex data: bit location of unit information. |
| static Int |
|
| static Int |
|
| static Int |
|
| static Int |
If |
| static Int |
If |
| static Int |
The data field holds an attribute resource identifier (referencing an attribute in the current theme style, not a resource entry). |
| static Int |
The data field holds a complex number encoding a dimension value. |
| static Int |
Identifies the start of integer values that were specified as color constants (starting with '#'). |
| static Int |
Identifies the start of plain integer values. |
| static Int |
The data field holds an IEEE 754 floating point number. |
| static Int |
The data field holds a complex number encoding a fraction of a container. |
| static Int |
|
| static Int |
The data field holds a color that was originally specified as #argb. |
| static Int |
The data field holds a color that was originally specified as #aarrggbb. |
| static Int |
The data field holds a color that was originally specified as #rgb. |
| static Int |
The data field holds a color that was originally specified as #rrggbb. |
| static Int |
The data field holds a number that was originally specified in decimal. |
| static Int |
The data field holds a number that was originally specified in hexadecimal (0xn). |
| static Int |
Identifies the end of integer values that were specified as color constants. |
| static Int |
Identifies the end of plain integer values. |
| static Int |
The value contains no data. |
| static Int |
The data field holds a resource identifier. |
| static Int |
The string field holds string data. |
| Public constructors | |
|---|---|
| Public methods | |
|---|---|
| open static Float |
applyDimension(unit: Int, value: Float, metrics: DisplayMetrics!)Converts an unpacked complex data value holding a dimension to its final floating point pixel value. |
| CharSequence! |
Regardless of the actual type of the value, try to convert it to a string value. |
| static String! |
coerceToString(type: Int, data: Int)Perform type conversion as per |
| open static Float |
complexToDimension(data: Int, metrics: DisplayMetrics!)Converts a complex data value holding a dimension to its final floating point value. |
| open static Int |
complexToDimensionPixelOffset(data: Int, metrics: DisplayMetrics!)Converts a complex data value holding a dimension to its final value as an integer pixel offset. |
| open static Int |
complexToDimensionPixelSize(data: Int, metrics: DisplayMetrics!)Converts a complex data value holding a dimension to its final value as an integer pixel size. |
| open static Float |
complexToFloat(complex: Int)Retrieve the base value from a complex data integer. |
| open static Float |
complexToFraction(data: Int, base: Float, pbase: Float)Converts a complex data value holding a fraction to its final floating point value. |
| open static Float |
convertDimensionToPixels(unitToConvertFrom: Int, value: Float, metrics: DisplayMetrics)Converts a dimension value to raw pixels, e. |
| open static Float |
convertPixelsToDimension(unitToConvertTo: Int, pixelValue: Float, metrics: DisplayMetrics)Converts a pixel value to the given dimension, e. |
| open static Float |
deriveDimension(unitToConvertTo: Int, pixelValue: Float, metrics: DisplayMetrics)Converts a pixel value to the given dimension, e. |
| open Int |
Return the complex unit type for this value. |
| open Float |
getDimension(metrics: DisplayMetrics!)Return the data for this value as a dimension. |
| Float |
getFloat()Return the data for this value as a float. |
| open Float |
getFraction(base: Float, pbase: Float)Return the data for this value as a fraction. |
| open Boolean |
Determine if a value is a color. |
| open Unit |
setTo(other: TypedValue!) |
| open String |
toString()Returns a string representation of the object. |
| Properties | |
|---|---|
| Int |
Additional information about where the value came from; only set for strings. |
| Int |
If the value came from a resource, these are the configurations for which its contents can change. |
| Int |
Basic data in the value, interpreted according to |
| Int |
If the Value came from a resource, this holds the corresponding pixel density. |
| Int |
If Value came from a resource, this holds the corresponding resource id. |
| Int |
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. |
| CharSequence! |
If the value holds a string, this is it. |
| Int |
The type held by this value, as defined by the constants here. |
Constants
COMPLEX_MANTISSA_MASK
static val COMPLEX_MANTISSA_MASK: Int
Complex data: mask to extract mantissa information (after shifting by COMPLEX_MANTISSA_SHIFT). This gives us 23 bits of precision; the top bit is the sign.
Value: 16777215COMPLEX_MANTISSA_SHIFT
static val COMPLEX_MANTISSA_SHIFT: Int
Complex data: bit location of mantissa information.
Value: 8COMPLEX_RADIX_0p23
static val COMPLEX_RADIX_0p23: Int
Complex data: the mantissa magnitude is 0 bits -- i.e, 0x0.nnnnnn
Value: 3COMPLEX_RADIX_16p7
static val COMPLEX_RADIX_16p7: Int
Complex data: the mantissa magnitude is 16 bits -- i.e, 0xnnnn.nn
Value: 1COMPLEX_RADIX_23p0
static val COMPLEX_RADIX_23p0: Int
Complex data: the mantissa is an integral number -- i.e., 0xnnnnnn.0
Value: 0COMPLEX_RADIX_8p15
static val COMPLEX_RADIX_8p15: Int
Complex data: the mantissa magnitude is 8 bits -- i.e, 0xnn.nnnn
Value: 2COMPLEX_RADIX_MASK
static val COMPLEX_RADIX_MASK: Int
Complex data: mask to extract radix information (after shifting by COMPLEX_RADIX_SHIFT). This give us 4 possible fixed point representations as defined below.
Value: 3COMPLEX_RADIX_SHIFT
static val COMPLEX_RADIX_SHIFT: Int
Complex data: where the radix information is, telling where the decimal place appears in the mantissa.
Value: 4COMPLEX_UNIT_DIP
static val COMPLEX_UNIT_DIP: Int
TYPE_DIMENSION complex unit: Value is Device Independent Pixels.
Value: 1COMPLEX_UNIT_FRACTION
static val COMPLEX_UNIT_FRACTION: Int
TYPE_FRACTION complex unit: A basic fraction of the overall size.
Value: 0COMPLEX_UNIT_FRACTION_PARENT
static val COMPLEX_UNIT_FRACTION_PARENT: Int
TYPE_FRACTION complex unit: A fraction of the parent size.
Value: 1COMPLEX_UNIT_IN
static val COMPLEX_UNIT_IN: Int
TYPE_DIMENSION complex unit: Value is in inches.
Value: 4COMPLEX_UNIT_MASK
static val COMPLEX_UNIT_MASK: Int
Complex data: mask to extract unit information (after shifting by COMPLEX_UNIT_SHIFT). This gives us 16 possible types, as defined below.
Value: 15COMPLEX_UNIT_MM
static val COMPLEX_UNIT_MM: Int
TYPE_DIMENSION complex unit: Value is in millimeters.
Value: 5COMPLEX_UNIT_PT
static val COMPLEX_UNIT_PT: Int
TYPE_DIMENSION complex unit: Value is in points.
Value: 3COMPLEX_UNIT_PX
static val COMPLEX_UNIT_PX: Int
TYPE_DIMENSION complex unit: Value is raw pixels.
Value: 0COMPLEX_UNIT_SHIFT
static val COMPLEX_UNIT_SHIFT: Int
Complex data: bit location of unit information.
Value: 0COMPLEX_UNIT_SP
static val COMPLEX_UNIT_SP: Int
TYPE_DIMENSION complex unit: Value is a scaled pixel