Class MotionKey
- java.lang.Object
-
- androidx.constraintlayout.core.motion.key.MotionKey
-
- All Implemented Interfaces:
TypedValues
- Direct Known Subclasses:
MotionKeyAttributes,MotionKeyCycle,MotionKeyPosition,MotionKeyTimeCycle,MotionKeyTrigger
public abstract class MotionKey extends java.lang.Object implements TypedValues
Base class in an element in a KeyFrame
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface androidx.constraintlayout.core.motion.utils.TypedValues
TypedValues.AttributesType, TypedValues.Custom, TypedValues.CycleType, TypedValues.MotionScene, TypedValues.MotionType, TypedValues.OnSwipe, TypedValues.PositionType, TypedValues.TransitionType, TypedValues.TriggerType
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringALPHAstatic java.lang.StringCUSTOMstatic java.lang.StringELEVATIONjava.util.HashMap<java.lang.String,CustomVariable>mCustomintmFramePositionintmTypestatic java.lang.StringROTATIONstatic java.lang.StringROTATION_Xstatic java.lang.StringSCALE_Xstatic java.lang.StringSCALE_Ystatic java.lang.StringTRANSITION_PATH_ROTATEstatic java.lang.StringTRANSLATION_Xstatic java.lang.StringTRANSLATION_Ystatic intUNSETstatic java.lang.StringVISIBILITY-
Fields inherited from interface androidx.constraintlayout.core.motion.utils.TypedValues
BOOLEAN_MASK, FLOAT_MASK, INT_MASK, S_CUSTOM, STRING_MASK, TYPE_FRAME_POSITION, TYPE_TARGET
-
-
Constructor Summary
Constructors Constructor Description MotionKey()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidaddValues(java.util.HashMap<java.lang.String,SplineSet> splines)Defines method to add a a view to splines derived form this key frame.abstract MotionKeyclone()MotionKeycopy(MotionKey src)abstract voidgetAttributeNames(java.util.HashSet<java.lang.String> attributes)intgetFramePosition()Gets the current frame positionvoidsetCustomAttribute(java.lang.String name, int type, boolean value)voidsetCustomAttribute(java.lang.String name, int type, float value)voidsetCustomAttribute(java.lang.String name, int type, int value)voidsetCustomAttribute(java.lang.String name, int type, java.lang.String value)voidsetFramePosition(int pos)sets the frame positionvoidsetInterpolation(java.util.HashMap<java.lang.String,java.lang.Integer> interpolation)Key frame can specify the type of interpolation it wants on various attributes For each string it set it to -1, CurveFit.LINEAR or CurveFit.SPLINEbooleansetValue(int type, boolean value)Used to set boolean valuesbooleansetValue(int type, float value)Used to set float valuesbooleansetValue(int type, int value)Used to set integer valuesbooleansetValue(int type, java.lang.String value)Used to set String valuesMotionKeysetViewId(int id)-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface androidx.constraintlayout.core.motion.utils.TypedValues
getId
-
-
-
-
Field Detail
-
UNSET
public static int UNSET
-
mFramePosition
public int mFramePosition
-
mType
public int mType
-
mCustom
public java.util.HashMap<java.lang.String,CustomVariable> mCustom
-
ALPHA
public static final java.lang.String ALPHA
- See Also:
- Constant Field Values
-
ELEVATION
public static final java.lang.String ELEVATION
- See Also:
- Constant Field Values
-
ROTATION
public static final java.lang.String ROTATION
- See Also:
- Constant Field Values
-
ROTATION_X
public static final java.lang.String ROTATION_X
- See Also:
- Constant Field Values
-
TRANSITION_PATH_ROTATE
public static final java.lang.String TRANSITION_PATH_ROTATE
- See Also:
- Constant Field Values
-
SCALE_X
public static final java.lang.String SCALE_X
- See Also:
- Constant Field Values
-
SCALE_Y
public static final java.lang.String SCALE_Y
- See Also:
- Constant Field Values
-
TRANSLATION_X
public static final java.lang.String TRANSLATION_X
- See Also:
- Constant Field Values
-
TRANSLATION_Y
public static final java.lang.String TRANSLATION_Y
- See Also:
- Constant Field Values
-
CUSTOM
public static final java.lang.String CUSTOM
- See Also:
- Constant Field Values
-
VISIBILITY
public static final java.lang.String VISIBILITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAttributeNames
public abstract void getAttributeNames(java.util.HashSet<java.lang.String> attributes)
-
addValues
public abstract void addValues(java.util.HashMap<java.lang.String,SplineSet> splines)
Defines method to add a a view to splines derived form this key frame. The values are written to the spline- Parameters:
splines- splines to write values to
-
setInterpolation
public void setInterpolation(java.util.HashMap<java.lang.String,java.lang.Integer> interpolation)
Key frame can specify the type of interpolation it wants on various attributes For each string it set it to -1, CurveFit.LINEAR or CurveFit.SPLINE
-
clone
public abstract MotionKey clone()
- Overrides:
clonein classjava.lang.Object
-
setViewId
public MotionKey setViewId(int id)
-
setFramePosition
public void setFramePosition(int pos)
sets the frame position
-
getFramePosition
public int getFramePosition()
Gets the current frame position
-
setValue
public boolean setValue(int type, int value)Description copied from interface:TypedValuesUsed to set integer values- Specified by:
setValuein interfaceTypedValues- Returns:
- true if it accepted the value
-
setValue
public boolean setValue(int type, float value)Description copied from interface:TypedValuesUsed to set float values- Specified by:
setValuein interfaceTypedValues- Returns:
- true if it accepted the value
-
setValue
public boolean setValue(int type, java.lang.String value)Description copied from interface:TypedValuesUsed to set String values- Specified by:
setValuein interfaceTypedValues- Returns:
- true if it accepted the value
-
setValue
public boolean setValue(int type, boolean value)Description copied from interface:TypedValuesUsed to set boolean values- Specified by:
setValuein interfaceTypedValues- Returns:
- true if it accepted the value
-
setCustomAttribute
public void setCustomAttribute(java.lang.String name, int type, float value)
-
setCustomAttribute
public void setCustomAttribute(java.lang.String name, int type, int value)
-
setCustomAttribute
public void setCustomAttribute(java.lang.String name, int type, boolean value)
-
setCustomAttribute
public void setCustomAttribute(java.lang.String name, int type, java.lang.String value)
-
-