public interface

MotionLayout.TransitionListener

 androidx.constraintlayout.motion.widget.MotionLayout.TransitionListener

Subclasses:

Carousel, MotionEffect, TransitionAdapter, MotionHelperInterface, MotionHelper

Overview

Listener for monitoring events about TransitionLayout. Added in 2.0

Summary

Methods
public voidonTransitionChange(MotionLayout motionLayout, int startId, int endId, float progress)

Called when a drawer's position changes.

public voidonTransitionCompleted(MotionLayout motionLayout, int currentId)

Called when a drawer has settled completely a state.

public voidonTransitionStarted(MotionLayout motionLayout, int startId, int endId)

Called when a drawer is about to start a transition.

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

Call when a trigger is fired

Methods

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: The TransitionLayout view that was moved
startId: the id of the start state (or ConstraintSet). Will be -1 if unknown.
endId: the id of the end state (or ConstraintSet).

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

Called when a drawer's position changes.

Parameters:

motionLayout: The TransitionLayout view that was moved
startId: the id of the start state (or ConstraintSet). Will be -1 if unknown.
endId: the id of the end state (or ConstraintSet).
progress: The progress on this transition, from 0 to 1.

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: Drawer view that is now open
currentId: the id it has reached

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

Call when a trigger is fired

Parameters:

motionLayout:
triggerId: The id set set with triggerID
positive: for positive transition edge
progress: