public class ConstraintAttribute


Defines non standard Attributes

Summary

Nested types

Public constructors

ConstraintAttribute(
    String name,
    ConstraintAttribute.AttributeType attributeType
)
ConstraintAttribute(
    String name,
    ConstraintAttribute.AttributeType attributeType,
    Object value,
    boolean method
)

Public methods

void

Apply custom attributes to the view

boolean
diff(ConstraintAttribute constraintAttribute)

test if the two attributes are different

static HashMap<StringConstraintAttribute>

extract attributes from the view

int
float
int
String
String
ConstraintAttribute.AttributeType
float

Transforms value to a float for the purpose of interpolation

void

populate the float array with colors it will fill 4 values

boolean
boolean

Continuous types are interpolated they are fired only at

boolean
int

The number of interpolation values that need to be interpolated Typically 1 but 3 for colors.

static void
parse(
    Context context,
    XmlPullParser parser,
    HashMap<StringConstraintAttribute> custom
)

parse Custom attributes and fill Custom

static void

set attributes from map on to the view

void
setColorValue(int value)
void
setFloatValue(float value)
void
setIntValue(int value)
void
void

set the value based on casting the object

void
setValue(float[] value)

setValue based on the values in the array

Public constructors

ConstraintAttribute

Added in 2.2.0-alpha13
public ConstraintAttribute(
    String name,
    ConstraintAttribute.AttributeType attributeType
)

ConstraintAttribute

Added in 2.2.0-alpha13
public ConstraintAttribute(ConstraintAttribute source, Object value)

ConstraintAttribute

Added in 2.2.0-alpha13
public ConstraintAttribute(
    String name,
    ConstraintAttribute.AttributeType attributeType,
    Object value,
    boolean method
)

Public methods

applyCustom

Added in 2.2.0-alpha13
public void applyCustom(View view)

Apply custom attributes to the view

Parameters
View view

diff

Added in 2.2.0-alpha13
public boolean diff(ConstraintAttribute constraintAttribute)

test if the two attributes are different

Parameters
ConstraintAttribute constraintAttribute
Returns
boolean

extractAttributes

Added in 2.2.0-alpha13
public static HashMap<StringConstraintAttributeextractAttributes(HashMap<StringConstraintAttribute> base, View view)

extract attributes from the view

Parameters
HashMap<StringConstraintAttribute> base
View view

getColorValue

Added in 2.2.0-alpha13
public int getColorValue()

getFloatValue

Added in 2.2.0-alpha13
public float getFloatValue()

getIntegerValue

Added in 2.2.0-alpha13
public int getIntegerValue()

getName

Added in 2.2.0-alpha13
public String getName()

getStringValue

Added in 2.2.0-alpha13
public String getStringValue()

getValueToInterpolate

Added in 2.2.0-alpha13
public float getValueToInterpolate()

Transforms value to a float for the purpose of interpolation

Returns
float

interpolation value

getValuesToInterpolate

Added in 2.2.0-alpha13
public void getValuesToInterpolate(float[] ret)

populate the float array with colors it will fill 4 values

Parameters
float[] ret

isBooleanValue

Added in 2.2.0-alpha13
public boolean isBooleanValue()

isContinuous

Added in 2.2.0-alpha13
public boolean isContinuous()

Continuous types are interpolated they are fired only at

Returns
boolean

isMethod

Added in 2.2.0-alpha13
public boolean isMethod()

numberOfInterpolatedValues

Added in 2.2.0-alpha13
public int numberOfInterpolatedValues()

The number of interpolation values that need to be interpolated Typically 1 but 3 for colors.

Returns
int

Typically 1 but 3 for colors.

parse

Added in 2.2.0-alpha13
public static void parse(
    Context context,
    XmlPullParser parser,
    HashMap<StringConstraintAttribute> custom
)

parse Custom attributes and fill Custom

Parameters
Context context
XmlPullParser parser
HashMap<StringConstraintAttribute> custom

setAttributes

Added in 2.2.0-alpha13
public static void setAttributes(View view, HashMap<StringConstraintAttribute> map)

set attributes from map on to the view

Parameters
View view
HashMap<StringConstraintAttribute> map

setColorValue

Added in 2.2.0-alpha13
public void setColorValue(int value)

setFloatValue

Added in 2.2.0-alpha13
public void setFloatValue(float value)

setIntValue

Added in 2.2.0-alpha13
public void setIntValue(int value)

setStringValue

Added in 2.2.0-alpha13
public void setStringValue(String value)

setValue

Added in 2.2.0-alpha13
public void setValue(Object value)

set the value based on casting the object

Parameters
Object value

setValue

Added in 2.2.0-alpha13
public void setValue(float[] value)

setValue based on the values in the array

Parameters
float[] value