Class Transition

  • All Implemented Interfaces:
    TypedValues

    public class Transition
    extends java.lang.Object
    implements TypedValues
    • Constructor Detail

      • Transition

        public Transition()
    • Method Detail

      • hasOnSwipe

        public boolean hasOnSwipe()
      • dragToProgress

        public float dragToProgress​(float currentProgress,
                                    int baseW,
                                    int baseH,
                                    float dx,
                                    float dy)
        Converts from xy drag to progress This should be used till touch up
        Parameters:
        baseW - parent width
        baseH - parent height
        dx - change in x
        dy - change in y
        Returns:
        the change in progress
      • setTouchUp

        public void setTouchUp​(float currentProgress,
                               long currentTime,
                               float velocityX,
                               float velocityY)
        Set the start of the touch up
        Parameters:
        currentProgress - 0...1 progress in
        currentTime - time in nanoseconds
        velocityX - pixels per millisecond
        velocityY - pixels per millisecond
      • getTouchUpProgress

        public float getTouchUpProgress​(long currentTime)
        get the current touch up progress current time in nanoseconds (ideally coming from an animation clock)
        Parameters:
        currentTime - in nanoseconds
        Returns:
        progress
      • isTouchNotDone

        public boolean isTouchNotDone​(float currentProgress)
        Are we still animating
        Parameters:
        currentProgress - motion progress
        Returns:
        true to continue moving
      • getInterpolator

        public static Interpolator getInterpolator​(int interpolator,
                                                   java.lang.String interpolatorString)
        get the interpolater based on a constant or a string
      • findPreviousPosition

        public androidx.constraintlayout.core.state.Transition.KeyPosition findPreviousPosition​(java.lang.String target,
                                                                                                int frameNumber)
      • findNextPosition

        public androidx.constraintlayout.core.state.Transition.KeyPosition findNextPosition​(java.lang.String target,
                                                                                            int frameNumber)
      • getNumberKeyPositions

        public int getNumberKeyPositions​(WidgetFrame frame)
      • getMotion

        public Motion getMotion​(java.lang.String id)
      • fillKeyPositions

        public void fillKeyPositions​(WidgetFrame frame,
                                     float[] x,
                                     float[] y,
                                     float[] pos)
      • hasPositionKeyframes

        public boolean hasPositionKeyframes()
      • setTransitionProperties

        public void setTransitionProperties​(TypedBundle bundle)
      • setValue

        public boolean setValue​(int id,
                                int value)
        Description copied from interface: TypedValues
        Used to set integer values
        Specified by:
        setValue in interface TypedValues
        Returns:
        true if it accepted the value
      • setValue

        public boolean setValue​(int id,
                                float value)
        Description copied from interface: TypedValues
        Used to set float values
        Specified by:
        setValue in interface TypedValues
        Returns:
        true if it accepted the value
      • setValue

        public boolean setValue​(int id,
                                java.lang.String value)
        Description copied from interface: TypedValues
        Used to set String values
        Specified by:
        setValue in interface TypedValues
        Returns:
        true if it accepted the value
      • setValue

        public boolean setValue​(int id,
                                boolean value)
        Description copied from interface: TypedValues
        Used to set boolean values
        Specified by:
        setValue in interface TypedValues
        Returns:
        true if it accepted the value
      • getId

        public int getId​(java.lang.String name)
        Specified by:
        getId in interface TypedValues
      • isEmpty

        public boolean isEmpty()
      • clear

        public void clear()
      • contains

        public boolean contains​(java.lang.String key)
      • addKeyPosition

        public void addKeyPosition​(java.lang.String target,
                                   TypedBundle bundle)
      • addKeyAttribute

        public void addKeyAttribute​(java.lang.String target,
                                    TypedBundle bundle)
      • addKeyCycle

        public void addKeyCycle​(java.lang.String target,
                                TypedBundle bundle)
      • addKeyPosition

        public void addKeyPosition​(java.lang.String target,
                                   int frame,
                                   int type,
                                   float x,
                                   float y)
      • addCustomFloat

        public void addCustomFloat​(int state,
                                   java.lang.String widgetId,
                                   java.lang.String property,
                                   float value)
      • addCustomColor

        public void addCustomColor​(int state,
                                   java.lang.String widgetId,
                                   java.lang.String property,
                                   int color)
      • updateFrom

        public void updateFrom​(ConstraintWidgetContainer container,
                               int state)
        Update container of parameters for the state
        Parameters:
        container - contains all the widget parameters
        state - starting or ending
      • interpolate

        public void interpolate​(int parentWidth,
                                int parentHeight,
                                float progress)
      • getStart

        public WidgetFrame getStart​(java.lang.String id)
      • getEnd

        public WidgetFrame getEnd​(java.lang.String id)
      • getInterpolated

        public WidgetFrame getInterpolated​(java.lang.String id)
      • getPath

        public float[] getPath​(java.lang.String id)
      • getKeyFrames

        public int getKeyFrames​(java.lang.String id,
                                float[] rectangles,
                                int[] pathMode,
                                int[] position)
      • getInterpolator

        public Interpolator getInterpolator()
        This gets the interpolator being used
      • getAutoTransition

        public int getAutoTransition()
        This gets the auto transition mode being used
      • calcStagger

        public void calcStagger()