Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

MotionLayout.TransitionListener

public static interface MotionLayout.TransitionListener

android.support.constraint.motion.MotionLayout.TransitionListener


Added in 2.0

Listener for monitoring events about TransitionLayout.

Summary

Public methods

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

Called when a drawer's position changes.

abstract void onTransitionCompleted(MotionLayout motionLayout, int currentId)

Called when a drawer has settled completely a state.

Public methods

onTransitionChange

public abstract 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 abstract 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