Register now for Android Dev Summit 2019!

TransitionAdapter

public abstract class TransitionAdapter
extends Object implements MotionLayout.TransitionListener

java.lang.Object
   ↳ androidx.constraintlayout.motion.widget.TransitionAdapter


Summary

Public constructors

TransitionAdapter()

Public methods

void onTransitionChange(MotionLayout motionLayout, int startId, int endId, float progress)

Called when a drawer's position changes.

void onTransitionCompleted(MotionLayout motionLayout, int currentId)

Called when a drawer has settled completely a state.

void onTransitionStarted(MotionLayout motionLayout, int startId, int endId)

Called when a drawer is about to start a transition.

void onTransitionTrigger(MotionLayout motionLayout, int triggerId, boolean positive, float progress)

Call when a trigger is fired

Inherited methods

Public constructors

TransitionAdapter

public TransitionAdapter ()

Public methods

onTransitionChange

public void onTransitionChange (MotionLayout motionLayout, 
                int startId, 
                int endId, 
                float progress)

Called when a drawer's position changes.

Parameters
motionLayout MotionLayout: The TransitionLayout view that was moved

startId int: the id of the start state (or ConstraintSet). Will be -1 if unknown.

endId int: the id of the end state (or ConstraintSet).

progress float: The progress on this transition, from 0 to 1.

onTransitionCompleted

public void onTransitionCompleted (MotionLayout motionLayout, 
                int currentId)

Called when a drawer has settled completely a state. The TransitionLayout is interactive at this point.

Parameters
motionLayout MotionLayout: Drawer view that is now open

currentId int: the id it has reached

onTransitionStarted

public void onTransitionStarted (MotionLayout motionLayout, 
                int startId, 
                int endId)

Called when a drawer is about to start a transition. Note. startId may be -1 if starting from an "undefined state"

Parameters
motionLayout MotionLayout: The TransitionLayout view that was moved

startId int: the id of the start state (or ConstraintSet). Will be -1 if unknown.

endId int: the id of the end state (or ConstraintSet).

onTransitionTrigger

public void onTransitionTrigger (MotionLayout motionLayout, 
                int triggerId, 
                boolean positive, 
                float progress)

Call when a trigger is fired

Parameters
triggerId int: The id set set with triggerID

positive boolean: for positive transition edge