MotionScene.Transition

public class MotionScene.Transition


Transition defines the interaction from one state to another. With out a Transition object Transition between two stats involves strictly linear interpolation

Summary

Constants

static final @NonNull int
static final @NonNull int
static final @NonNull int
static final @NonNull int
static final @NonNull int

Public constructors

Transition(
    @NonNull int id,
    @NonNull MotionScene motionScene,
    @NonNull int constraintSetStartId,
    @NonNull int constraintSetEndId
)

Create a transition

Public methods

@NonNull void
@NonNull void
addOnClick(@NonNull int id, @NonNull int action)
@NonNull void
@NonNull String

Print a debug string indicating the starting and ending state of the transition

@NonNull int

return the autoTransitionType.

@NonNull int

gets the default transition duration

@NonNull int

Get the id of the constraint set to go to

@NonNull int

Transitions can be given and ID.

@NonNull List<@NonNull KeyFrames>
@NonNull int
@NonNull List<@NonNull MotionScene.Transition.TransitionOnClick>

Get the onClick handlers.

@NonNull int

gets the pathMotionArc for the all motions in this transition.

@NonNull float

Gets the stagger value.

@NonNull int

Gets the id of the starting constraint set

@NonNull TouchResponse

Get the Touch response manager

@NonNull boolean

Returns true if this Transition can be auto considered for transition Default is enabled

@NonNull boolean
@NonNull void
@NonNull void

sets the autoTransitionType On reaching a state auto transitions may be run based on one of AUTO_NONE, AUTO_JUMP_TO_START, AUTO_JUMP_TO_END, AUTO_ANIMATE_TO_START, AUTO_ANIMATE_TO_END

@NonNull void
setDuration(@NonNull int duration)

sets the duration of the transition if set to < 8 it will be set to 8

@NonNull void
setEnable(@NonNull boolean enable)

This method is deprecated.

This method should be called {@code setEnabled}, so that {@code isEnabled} can be accessed as a property from Kotlin.

@NonNull void
setEnabled(@NonNull boolean enable)

enable or disable the Transition.

@NonNull void
setInterpolatorInfo(
    @NonNull int interpolator,
    @NonNull String interpolatorString,
    @NonNull int interpolatorID
)
@NonNull void
@NonNull void
@NonNull void
setOnTouchUp(@NonNull int touchUpMode)
@NonNull void
setPathMotionArc(@NonNull int arcMode)

Sets the pathMotionArc for the all motions in this transition.

@NonNull void
setStagger(@NonNull float stagger)

Sets the stagger value.

@NonNull void

Constants

AUTO_ANIMATE_TO_END

@NonNull
public static final @NonNull int AUTO_ANIMATE_TO_END

AUTO_ANIMATE_TO_START

@NonNull
public static final @NonNull int AUTO_ANIMATE_TO_START

AUTO_JUMP_TO_END

@NonNull
public static final @NonNull int AUTO_JUMP_TO_END

AUTO_JUMP_TO_START

@NonNull
public static final @NonNull int AUTO_JUMP_TO_START

AUTO_NONE

@NonNull
public static final @NonNull int AUTO_NONE

Public constructors

Transition

public Transition(
    @NonNull int id,
    @NonNull MotionScene motionScene,
    @NonNull int constraintSetStartId,
    @NonNull int constraintSetEndId
)

Create a transition

Parameters
@NonNull int id

a unique id to represent the transition.

@NonNull MotionScene motionScene

the motion scene that the transition will be added to.

@NonNull int constraintSetStartId

id of the ConstraintSet to be used for the start of transition

@NonNull int constraintSetEndId

id of the ConstraintSet to be used for the end of transition

Public methods

addKeyFrame

@NonNull
public void addKeyFrame(@NonNull KeyFrames keyFrames)

addOnClick

@NonNull
public void addOnClick(@NonNull int id, @NonNull int action)

addOnClick

@NonNull
public void addOnClick(@NonNull Context context, @NonNull XmlPullParser parser)

debugString

@NonNull
public String debugString(@NonNull Context context)

Print a debug string indicating the starting and ending state of the transition

Parameters
@NonNull Context context
Returns
String

getAutoTransition

@NonNull
public int getAutoTransition()

return the autoTransitionType. one of AUTO_NONE, AUTO_JUMP_TO_START, AUTO_JUMP_TO_END, AUTO_ANIMATE_TO_START, AUTO_ANIMATE_TO_END

Returns
int

0=NONE, 1=JUMP_TO_START, 2=JUMP_TO_END, 3=ANIMATE_TO_START, 4=ANIMATE_TO_END

getDuration

@NonNull
public int getDuration()

gets the default transition duration

Returns
int

duration int milliseconds

getEndConstraintSetId

@NonNull
public int getEndConstraintSetId()

Get the id of the constraint set to go to

Returns
int

getId

@NonNull
public int getId()

Transitions can be given and ID. If unset it returns UNSET (-1)

Returns
int

The Id of the Transition set in the MotionScene File or UNSET (-1)

getKeyFrameList

@NonNull
public List<@NonNull KeyFramesgetKeyFrameList()

getLayoutDuringTransition

@NonNull
public int getLayoutDuringTransition()

getOnClickList

@NonNull
public List<@NonNull MotionScene.Transition.TransitionOnClickgetOnClickList()

Get the onClick handlers.

Returns
List<@NonNull MotionScene.Transition.TransitionOnClick>

list of on click handler

getPathMotionArc

@NonNull
public int getPathMotionArc()

gets the pathMotionArc for the all motions in this transition. if set to UNSET (default) it reverts to the setting of the constraintSet

Returns
int

arcMode

getStagger

@NonNull
public float getStagger()

Gets the stagger value.

Returns
float

getStartConstraintSetId

@NonNull
public int getStartConstraintSetId()

Gets the id of the starting constraint set

Returns
int

getTouchResponse

@NonNull
public TouchResponse getTouchResponse()

Get the Touch response manager

Returns
TouchResponse

isEnabled

@NonNull
public boolean isEnabled()

Returns true if this Transition can be auto considered for transition Default is enabled

isTransitionFlag

@NonNull
public boolean isTransitionFlag(@NonNull int flag)

removeOnClick

@NonNull
public void removeOnClick(@NonNull int id)

setAutoTransition

@NonNull
public void setAutoTransition(@NonNull int type)

sets the autoTransitionType On reaching a state auto transitions may be run based on one of AUTO_NONE, AUTO_JUMP_TO_START, AUTO_JUMP_TO_END, AUTO_ANIMATE_TO_START, AUTO_ANIMATE_TO_END

Returns
void

0=NONE, 1=JUMP_TO_START, 2=JUMP_TO_END, 3=ANIMATE_TO_START, 4=ANIMATE_TO_END

setDuration

@NonNull
public void setDuration(@NonNull int duration)

sets the duration of the transition if set to < 8 it will be set to 8

Parameters
@NonNull int duration

in milliseconds (min is 8)

setEnable

@NonNull
public void setEnable(@NonNull boolean enable)

Enable or disable the Transition. If a Transition is disabled it is not eligible for automatically switching to.

Parameters
@NonNull boolean enable

setEnabled

@NonNull
public void setEnabled(@NonNull boolean enable)

enable or disable the Transition. If a Transition is disabled it is not eligible for automatically switching to.

Parameters
@NonNull boolean enable

setInterpolatorInfo

@NonNull
public void setInterpolatorInfo(
    @NonNull int interpolator,
    @NonNull String interpolatorString,
    @NonNull int interpolatorID
)

setLayoutDuringTransition

@NonNull
public void setLayoutDuringTransition(@NonNull int mode)

setOnSwipe

@NonNull
public void setOnSwipe(@NonNull OnSwipe onSwipe)

setOnTouchUp

@NonNull
public void setOnTouchUp(@NonNull int touchUpMode)

setPathMotionArc

@NonNull
public void setPathMotionArc(@NonNull int arcMode)

Sets the pathMotionArc for the all motions in this transition. if set to UNSET (default) it reverts to the setting of the constraintSet

Parameters
@NonNull int arcMode

setStagger

@NonNull
public void setStagger(@NonNull float stagger)

Sets the stagger value. A Stagger value of zero means no stagger. A Stagger value of 1 means the last view starts moving at .5 progress

Parameters
@NonNull float stagger

setTransitionFlag

@NonNull
public void setTransitionFlag(@NonNull int flag)