Class CustomVariable
- java.lang.Object
-
- androidx.constraintlayout.core.motion.CustomVariable
-
public class CustomVariable extends java.lang.ObjectDefines non standard Attributes
-
-
Constructor Summary
Constructors Constructor Description CustomVariable(CustomVariable c)CustomVariable(CustomVariable source, java.lang.Object value)CustomVariable(java.lang.String name, int attributeType)CustomVariable(java.lang.String name, int type, boolean value)CustomVariable(java.lang.String name, int type, float value)CustomVariable(java.lang.String name, int type, int value)CustomVariable(java.lang.String name, int attributeType, java.lang.Object value)CustomVariable(java.lang.String name, int type, java.lang.String value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyToWidget(MotionWidget view)static java.lang.StringcolorString(int v)CustomVariablecopy()booleandiff(CustomVariable customAttribute)test if the two attributes are differentbooleangetBooleanValue()intgetColorValue()floatgetFloatValue()intgetIntegerValue()intgetInterpolatedColor(float[] value)java.lang.StringgetName()java.lang.StringgetStringValue()intgetType()voidgetValuesToInterpolate(float[] ret)floatgetValueToInterpolate()Transforms value to a float for the purpose of interpolationstatic inthsvToRgb(float hue, float saturation, float value)booleanisContinuous()Continuous types are interpolated they are fired only atintnumberOfInterpolatedValues()The number of interpolation values that need to be interpolated Typically 1 but 3 for colors.static intrgbaTocColor(float r, float g, float b, float a)voidsetBooleanValue(boolean value)voidsetFloatValue(float value)voidsetInterpolatedValue(MotionWidget view, float[] value)voidsetIntValue(int value)voidsetStringValue(java.lang.String value)voidsetValue(float[] value)voidsetValue(java.lang.Object value)java.lang.StringtoString()
-
-
-
Constructor Detail
-
CustomVariable
public CustomVariable(CustomVariable c)
-
CustomVariable
public CustomVariable(java.lang.String name, int type, java.lang.String value)
-
CustomVariable
public CustomVariable(java.lang.String name, int type, int value)
-
CustomVariable
public CustomVariable(java.lang.String name, int type, float value)
-
CustomVariable
public CustomVariable(java.lang.String name, int type, boolean value)
-
CustomVariable
public CustomVariable(java.lang.String name, int attributeType)
-
CustomVariable
public CustomVariable(java.lang.String name, int attributeType, java.lang.Object value)
-
CustomVariable
public CustomVariable(CustomVariable source, java.lang.Object value)
-
-
Method Detail
-
copy
public CustomVariable copy()
-
colorString
public static java.lang.String colorString(int v)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getType
public int getType()
-
getBooleanValue
public boolean getBooleanValue()
-
getFloatValue
public float getFloatValue()
-
getColorValue
public int getColorValue()
-
getIntegerValue
public int getIntegerValue()
-
getStringValue
public java.lang.String getStringValue()
-
isContinuous
public boolean isContinuous()
Continuous types are interpolated they are fired only at
-
setFloatValue
public void setFloatValue(float value)
-
setBooleanValue
public void setBooleanValue(boolean value)
-
setIntValue
public void setIntValue(int value)
-
setStringValue
public void setStringValue(java.lang.String value)
-
numberOfInterpolatedValues
public int numberOfInterpolatedValues()
The number of interpolation values that need to be interpolated Typically 1 but 3 for colors.- Returns:
- Typically 1 but 3 for colors.
-
getValueToInterpolate
public float getValueToInterpolate()
Transforms value to a float for the purpose of interpolation- Returns:
- interpolation value
-
getValuesToInterpolate
public void getValuesToInterpolate(float[] ret)
-
setValue
public void setValue(float[] value)
-
hsvToRgb
public static int hsvToRgb(float hue, float saturation, float value)
-
diff
public boolean diff(CustomVariable customAttribute)
test if the two attributes are different
-
setValue
public void setValue(java.lang.Object value)
-
getInterpolatedColor
public int getInterpolatedColor(float[] value)
-
setInterpolatedValue
public void setInterpolatedValue(MotionWidget view, float[] value)
-
rgbaTocColor
public static int rgbaTocColor(float r, float g, float b, float a)
-
applyToWidget
public void applyToWidget(MotionWidget view)
-
getName
public java.lang.String getName()
-
-