ConstraintAttribute
public class ConstraintAttribute
Defines non standard Attributes
Summary
Nested types |
|---|
public enum ConstraintAttribute.AttributeType |
Public constructors |
|---|
ConstraintAttribute( |
ConstraintAttribute(ConstraintAttribute source, Object value) |
ConstraintAttribute( |
Public methods |
|
|---|---|
void |
applyCustom(View view)Apply custom attributes to the view |
boolean |
diff(ConstraintAttribute constraintAttribute)test if the two attributes are different |
static HashMap<String, ConstraintAttribute> |
extractAttributes(HashMap<String, ConstraintAttribute> base, View view)extract attributes from the view |
int |
|
float |
|
int |
|
String |
getName() |
String |
|
ConstraintAttribute.AttributeType |
getType() |
float |
Transforms value to a float for the purpose of interpolation |
void |
getValuesToInterpolate(float[] ret)populate the float array with colors it will fill 4 values |
boolean |
|
boolean |
Continuous types are interpolated they are fired only at |
boolean |
isMethod() |
int |
The number of interpolation values that need to be interpolated Typically 1 but 3 for colors. |
static void |
parse(parse Custom attributes and fill Custom |
static void |
setAttributes(View view, HashMap<String, ConstraintAttribute> map)set attributes from map on to the view |
void |
setColorValue(int value) |
void |
setFloatValue(float value) |
void |
setIntValue(int value) |
void |
setStringValue(String value) |
void |
set the value based on casting the object |
void |
setValue(float[] value)setValue based on the values in the array |
Public constructors
ConstraintAttribute
public ConstraintAttribute(
String name,
ConstraintAttribute.AttributeType attributeType
)
ConstraintAttribute
public ConstraintAttribute(ConstraintAttribute source, Object value)
ConstraintAttribute
public ConstraintAttribute(
String name,
ConstraintAttribute.AttributeType attributeType,
Object value,
boolean method
)
Public methods
applyCustom
public void applyCustom(View view)
Apply custom attributes to the view
| Parameters | |
|---|---|
View view |
diff
public boolean diff(ConstraintAttribute constraintAttribute)
test if the two attributes are different
| Parameters | |
|---|---|
ConstraintAttribute constraintAttribute |
| Returns | |
|---|---|
boolean |
extractAttributes
public static HashMap<String, ConstraintAttribute> extractAttributes(HashMap<String, ConstraintAttribute> base, View view)
extract attributes from the view
| Parameters | |
|---|---|
HashMap<String, ConstraintAttribute> base |
|
View view |
| Returns | |
|---|---|
HashMap<String, ConstraintAttribute> |
getValueToInterpolate
public float getValueToInterpolate()
Transforms value to a float for the purpose of interpolation
| Returns | |
|---|---|
float |
interpolation value |
getValuesToInterpolate
public void getValuesToInterpolate(float[] ret)
populate the float array with colors it will fill 4 values
| Parameters | |
|---|---|
float[] ret |
isContinuous
public boolean isContinuous()
Continuous types are interpolated they are fired only at
| Returns | |
|---|---|
boolean |
numberOfInterpolatedValues
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
public static void parse(
Context context,
XmlPullParser parser,
HashMap<String, ConstraintAttribute> custom
)
parse Custom attributes and fill Custom
| Parameters | |
|---|---|
Context context |
|
XmlPullParser parser |
|
HashMap<String, ConstraintAttribute> custom |
setAttributes
public static void setAttributes(View view, HashMap<String, ConstraintAttribute> map)
set attributes from map on to the view
| Parameters | |
|---|---|
View view |
|
HashMap<String, ConstraintAttribute> map |